Help Center> Object Storage Service> obsutil> Auxiliary Commands> Updating a Configuration File
Updated on 2024-01-09 GMT+08:00

Updating a Configuration File

Function

You can use this command to update some items in the .obsutilconfig file, including the endpoint, AK, SK, and token.

For details about the parameters in the .obsutilconfig file, see Parameter Description.

Command Line Structure

  • In Windows
    • Updating configurations in interactive mode
      obsutil config [-interactive] [-crr] [-config=xxx]
    • Directly updating configurations
      obsutil config [-e=xxx] [-i=xxx] [-k=xxx] [-t=xxx] [-crr] [-config=xxx]
  • In Linux or macOS
    • Updating configurations in interactive mode
      ./obsutil config [-interactive] [-crr] [-config=xxx]
    • Directly updating configurations
      ./obsutil config [-e=xxx] [-i=xxx] [-k=xxx] [-t=xxx] [-crr] [-config=xxx]
  • After options -i, -k, and -e are used to configure user information for authentication, you can run the history command in Linux or other operating systems to query the parameter values. Exercise caution when performing this operation.

Examples

  • Take Windows as an example. Run the obsutil config -interactive command to update the access keys and OBS endpoint in the default configuration file.
    obsutil config -interactive
    
    Please input your ak:
    xxxxxxxxxxxxxxxxxxxxxxxxx
    Please input your sk:
    xxxxxxxxxxxxxxxxxxxxxxxxx
    Please input your endpoint:
    xxxxxxxxxxxxxxxxxxxxxxxxx
    Please input your token:
    xxxxxxxxxxxxxxxxxxxxxxxxx
    Config file url:
      C:\Users\tools\.obsutilconfig
    
    Update config file successfully!
  • Take Linux as an example. Run the ./obsutil config -interactive command to update the access keys and OBS endpoint in the default configuration file.
    ./obsutil config -interactive
    
    Please input your ak:
    xxxxxxxxxxxxxxxxxxxxxxxxx
    Please input your sk:
    xxxxxxxxxxxxxxxxxxxxxxxxx
    Please input your endpoint:
    xxxxxxxxxxxxxxxxxxxxxxxxx
    Please input your token:
    xxxxxxxxxxxxxxxxxxxxxxxxx
    Config file url:
      /root/.obsutilconfig
    
    Update config file successfully!

Parameter Description

Parameter

Optional or Mandatory

Description

interactive

Optional (additional parameter)

Updates configurations in interactive mode.

NOTICE:

You are advised to configure AK and SK in interactive mode for security purpose.

e

Optional (additional parameter)

Changes the values of endpoint and endpointCrr in the configuration file to the entered ones. For parameter details, see Parameter Description.

i

Optional (additional parameter)

Changes the values of ak and akCrr in the configuration file to the entered ones. For parameter details, see Parameter Description.

k

Optional (additional parameter)

Changes the values of sk and skCrr in the configuration file to the entered ones. For parameter details, see Parameter Description.

t

Optional (additional parameter)

Changes the values of token and tokenCrr in the configuration file to the entered ones. For parameter details, see Parameter Description.

crr

Optional (additional parameter)

Updates the configurations for client-side cross-region replication in the configuration file.

NOTE:

If this parameter is not configured, the fields updated by e, i, k, and t are endpoint, ak, sk, and token in the configuration file respectively.

If this parameter is configured, the fields updated by e, i, k, and t in the configuration file are changed to endpointCrr, akCrr, skCrr, and tokenCrr respectively.

config

Optional (additional parameter)

User-defined configuration file for executing a command. For details about parameters that can be configured, see Parameter Description.

If this parameter is configured and a path is specified, parameters in the user-defined configuration file can be updated. If this parameter is not configured, parameters in the default configuration file are updated.