• Object Storage Service

obs
  1. Help Center
  2. Object Storage Service
  3. User Guide (S3cmd)
  4. Set-Up
  5. Interconnection with OBS

Interconnection with OBS

After S3cmd is successfully installed, configure the interconnection between OBS and S3cmd. You can use S3cmd to access OBS only after being authenticated by OBS.

Prerequisites

  • You have prepared resources (including S3cmd installation and the access key) needed for the interconnection.
  • (Optional) If you use client-side encryption, install the GPG encryption software beforehand and obtain the software's installation path.

Procedure

  1. Log in to the host where S3cmd is installed as user root.
  2. Open the command line tool.
  3. Run the following command to perform basic configuration for S3cmd:

    s3cmd --configure

  4. Enter the AK, SK, and region information following the instructions in the command output. Table 1 describes the parameters.

    NOTE:

    You can press Enter to skip optional parameters.

    Table 1 Parameters

    Parameter

    Description

    Mandatory or Optional

    Access Key

    The AK to access OBS.

    Mandatory

    Secret Key

    The SK to access OBS.

    Mandatory

    Default Region

    Bucket storage region.

    Obtain the latest region information from Regions and Endpoints.

    Mandatory

    Encryption password

    The encryption password needed when you use client-side encryption to transmit data.

    Optional

    Path to GPG program

    The path of the GPG encryption software when you use client-side encryption to transmit data.

    Optional

    Use HTTPS protocol

    Whether to use the Hypertext Transfer Protocol Secure (HTTPS) protocol.

    • If yes, set the value of this parameter to Yes.
    • If no, set the value of this parameter to No.

    Optional

    HTTP Proxy server name

    Whether to enable the Hypertext Transfer Protocol (HTTP) proxy when HTTPS is not enabled. If this parameter is null, the HTTP proxy is not used.

    Optional

    After the previous basic parameters are configured, the current configuration result is generated for your confirmation. The following information is displayed at the end of the command output:
    Test access with supplied credentials? [Y/n]

  5. Enter n to quit verifying the access key.

    NOTE:

    By default, S3cmd sends a request to Amazon S3. If you enter Y instead, a message is displayed, indicating an AK and SK authentication failure.

    The following information is displayed at the end of the command output:

    Save settings? [y/N] 

  6. Enter y to save the current configuration.

    After the current configuration is saved, S3cmd will automatically generate file .s3cfg under directory $HOME. The file includes all configuration information about S3cmd.

  7. Run the following command to open file .s3cfg:

    vi ~/.s3cfg

  8. Press i to go to the edit mode. Locate parameters host_base and host_bucket and change the values to the endpoint addresses.

    You can configure endpoint addresses based on your region locations, to shorten the response latency. You can obtain the latest region information from Regions and Endpoints.

    NOTE:

    Configure an endpoint address based on its owning region information. Otherwise, a request error occurs.

  9. Locate parameter website_endpoint at the end of the .s3cfg configuration file, and change the value to the domain name of the static website hosted by OBS.

    website_endpoint = http://%(bucket)s.obs-website.%(location)s.otc.t-systems.com

  10. Press Esc, input :wq!, and press Enter to save and exit the vi editor.
  11. (Optional) After the configuration, run the following command to view the configuration information about S3cmd:

    s3cmd --dump-config

  12. Run the following command to configure S3cmd:

    s3cmd --configure

    NOTE:

    The value of a configured parameter is displayed in the square brackets ([]) after this parameter.

  13. Press Enter to skip the AK and SK configuration items until the following message is displayed:

    Test access with supplied credentials? [Y/n]

  14. Enter Y to start authenticating the interconnection with OBS.

    If the information in the red-line box, as shown in Figure 1, is displayed in the command output, it indicates that S3cmd has connected to OBS successfully.

    Figure 1 Verifying the interconnection

  15. Enter y to save the current configuration.