Skip to main content

Change authentication credentials

If you need to manage resources of another account, project, pool, or use another service user, change your authentication credentials.

The process of changing credentials depends on how you configured OpenStack API authentication:

Change authentication credentials in the OS

  1. Open the CLI.

  2. Open the RC file in the nano text editor:

    nano /<directory_name>/<file_name>

    Specify:

    • <directory_name> — name of the directory with the RC file and Dockerfile;
    • <file_name> — name of the RC file that you downloaded to configure OpenStack CLI. Default is rc.sh.
  3. Change the authentication credentials in the file:

    export OS_PROJECT_DOMAIN_NAME='<account_id>'
    export OS_PROJECT_ID='<project_id>'
    export OS_TENANT_ID='<project_id>'
    export OS_REGION_NAME='<pool>'

    export OS_USER_DOMAIN_NAME='<account_id>'
    export OS_USERNAME='<user_name>'

    Specify:

    • <account_id> — account number. Can be viewed in the control panel in the upper-right corner;
    • <project_id> — project ID. Can be copied in the control panel: in the top menu, click Products and select Cloud Servers → open the project menu (name of the current project) → in the row of the required project, click ;
    • <pool> — pool, for example, ru-2;
    • <user_name> — name of the service user who has access to resource management. Can be viewed in the control panel: in the top menu, click IAM → Service Users.
  4. Exit the nano text editor saving changes: press Ctrl+X, then Y+Enter.

  5. Apply the environment variables from the RC file:

    source <file_name>

    Specify <file_name> — name of the RC file that you downloaded to configure OpenStack CLI. Default is rc.sh.

  6. Enter the OpenStack password — the password of the service user you specified in step 3.

  7. Verify that OpenStack CLI is working. To do this, open the cloud servers list:

    openstack server list

    If cloud servers have been created in the pool and project specified in the variables, their list will appear in the response. If no servers have been created, the response will be an empty line.

Change authentication credentials in the Docker container

  1. Open the CLI.

  2. Open the RC file in the nano text editor:

    nano /<docker_directory>/<file_name>

    Specify:

    • <docker_directory> — name of the directory where you moved the RC file and Dockerfile;
    • <file_name> — name of the RC file that you downloaded to configure OpenStack CLI. Default is rc.sh.
  3. Change the authentication credentials in the file:

    export OS_PROJECT_DOMAIN_NAME='<account_id>'
    export OS_PROJECT_ID='<project_id>'
    export OS_TENANT_ID='<project_id>'
    export OS_REGION_NAME='<pool>'

    export OS_USER_DOMAIN_NAME='<account_id>'
    export OS_USERNAME='<user_name>'

    Specify:

    • <account_id> — account number. Can be viewed in the control panel in the upper-right corner;
    • <project_id> — project ID. Can be copied in the control panel: in the top menu, click Products and select Cloud Servers → open the project menu (name of the current project) → in the row of the required project, click ;
    • <pool> — pool, for example, ru-2;
    • <user_name> — name of the service user who has access to resource management. Can be viewed in the control panel: in the top menu, click IAM → Service Users.
  4. Exit the nano text editor saving changes: press Ctrl+X, then Y+Enter.

  5. Run the Docker container:

    docker run -ti --rm -v $(pwd):/workspace osc:dalmatian
  6. Apply the environment variables from the RC file:

    source <file_name>

    Specify <file_name> — name of the RC file that you downloaded to configure OpenStack CLI. Default is rc.sh.

  7. Enter the OpenStack password — the password of the service user for whom the RC file was created.

  8. Verify that OpenStack CLI is working. To do this, open the cloud servers list:

    openstack server list

    If cloud servers have been created in the pool and project specified in the variables, their list will appear in the command output. If no servers have been created, the command output will be an empty line.