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:
- if you configured authorization using the operating system — change authorization credentials in the OS;
- if you configured authorization in a Docker container — change the authorization credentials in the Docker container.
Change authentication credentials in the OS
Linux/macOS
Windows
-
Open the CLI.
-
Open the RC file in the
nanotext 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 isrc.sh.
-
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.
-
Exit the
nanotext editor saving changes: press Ctrl+X, then Y+Enter. -
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 isrc.sh. -
Enter the OpenStack password — the password of the service user you specified in step 3.
-
Verify that OpenStack CLI is working. To do this, open the cloud servers list:
openstack server listIf 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
-
Open the CLI.
-
Open the RC file in the
nanotext 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 isrc.sh.
-
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.
-
Exit the
nanotext editor saving changes: press Ctrl+X, then Y+Enter. -
Run the Docker container:
docker run -ti --rm -v $(pwd):/workspace osc:dalmatian -
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 isrc.sh. -
Enter the OpenStack password — the password of the service user for whom the RC file was created.
-
Verify that OpenStack CLI is working. To do this, open the cloud servers list:
openstack server listIf 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.