Updated on 2024-12-11 GMT+08:00

Preparing the Environment

To use obsutil, you need to register a cloud service account, enable OBS, and obtain the access keys (AK and SK) first.

  1. Register a cloud service account.

    Before using OBS, ensure that you have a cloud service account.

    1. Open a browser.
    2. Log in to the Huawei Cloud official website.
    3. In the upper right corner of the page, click Register.
    4. Enter the registration information and click Register.

  2. Enable OBS.

    Ensure that your account balance is sufficient before using OBS.

    1. Log in to the management console.
    2. Click Billing & Costs from the top menu bar. The Billing Center page is displayed.
    3. Choose Funds Management > Top Up. The Top Up page is displayed.
    4. Top up the account as prompted.
    5. Go back to the management console page after the recharging is successful.
    6. Choose Service List > Object Storage Service to access OBS Console.

  3. (Optional) Create an IAM user.

    For data security, it is recommended that you do not use the account directly to access OBS. Through the Identity and Access Management (IAM) service, you can create a user who has the permission to access OBS resources and manage buckets and objects on obsutil. If you do not need to use any IAM user, skip this step.
    1. On the top navigation bar of the console, click in the upper left corner and choose Management & Governance > Identity and Access Management.
    2. On the displayed IAM console page, create a user group with OBS permissions configured.

      For details, see Creating a User Group. After the user group is created, locate the row that displays Global service > OBS in the User Group Permissions, and click Configure Policy in the row to set OBS permissions for the user group.

      For details about OBS policies, see Permissions Management.

    3. Create a user.

      For details, see Creating an IAM User. When creating a user, set the User Group to the one created in 3.b with OBS permissions configured and set the access type to Programmatic access.

      • If the user group is not configured with OBS permissions, you can configure fine-grain permissions on OBS Console through bucket policies or object policies. For details, see OBS Permission Control.
      • If Programming access is not enabled during user creation, enable it by following the instructions provided in Viewing or Modifying IAM User Information.

  4. Obtain access keys.

    OBS uses AKs and SKs in user accounts for signature verification to ensure that only authorized accounts can access specified OBS resources. Detailed explanations about AK and SK are as follows:

    • Access key ID (AK): indicates the ID of the access key, which is a unique identifier used together with a secret access key to sign requests cryptographically.
    • Secret access key (SK): indicates the private key used together with its associated AK to cryptographically sign requests. The AK and SK are used together to identify a request sender to prevent the request from being modified.

    Each user can create a maximum of two valid AK and SK pairs.

    Create access keys as follows:

    1. In the upper right corner of the console page, select My Credentials under the username.
    2. On the My Credentials page, select Access Keys in the navigation pane on the left.
    3. On the Access Keys page, click Add Access Key.

      Each user can create a maximum of two valid AK and SK pairs.

    4. In the Add Access Key dialog box that is displayed, enter the password and its verification code.
      • If you have not bound an email address or mobile number, enter only the password.
      • If you have bound an email address and a mobile number, you can select the verification by email or mobile phone.
    5. Click OK.
    6. In the Download Access Key dialog box that is displayed, click OK to save the access keys to your browser's default download path.

      Keep the access keys properly to prevent information leakage. If you click Cancel in the dialog box, the access keys will not be downloaded, and you cannot download them later. Re-create access keys if required.

    7. Open the downloaded credentials.csv file to obtain the access keys (AK and SK).

      In the access key file, the value in the Access Key ID column is the AK, and the value in the Secret Access Key column is the SK.