---
title: "Change authentication credentials in OpenStack API"
sidebar_label: "Change authentication credentials in OpenStack API"
sidebar_position: 4
description: "How to change authentication credentials in OpenStack API"
---

import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
import CopyIcon from '@selectel/docux/icons/copy'
import {TabItemLabel} from '@selectel/docux/components'
import Formbricks from '@theme/MDXComponents/Formbricks'

# 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 authentication via the operating system – [change authentication credentials in the OS](#edit-authorization-data-in-os);
* if you configured authentication in a Docker container – [change authentication credentials in the Docker container](#edit-authorization-data-in-docker).

### Change authentication credentials in the OS \{#edit-authorization-data-in-os}

<Tabs queryString="edit-authorization-data-in-os">
  <TabItem value="unix">
    <TabItemLabel>
      Linux/macOS
    </TabItemLabel>

    1. Open the CLI.

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

       ```bash
       nano /<directory_name>/<file_name>
       ```

       Specify:

       * `<directory_name>` — name of the directory with the RC file and Dockerfile;
       * `<file_name>` — the RC file name you [downloaded](/cloud-servers/tools/openstack-cli/configure-openstack-cli.mdx#download-rc-file-for-docker) to configure OpenStack CLI. The default is `rc.sh`.

    3. Change the authentication credentials in the file:

       ```bash
       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 ID. You can view it in the [control panel](https://my.selectel.ru/) in the top-right corner;
       * `<project_id>` — project ID. You can copy it in the [control panel](https://my.selectel.ru/vpc/): from the top menu, click **Products** and select **Cloud Servers** → open the projects menu (the name of the current project) → in the project line, click <CopyIcon />;
       * `<pool>` — [pool](/infrastructure/locations.mdx#pool), for example, `ru-2`;
       * `<user_name>` — name of the service user who has access to resource management. You can view it in the [control panel](https://my.selectel.ru/iam/service-users): from the top menu, click **IAM** → **Service Users** section.

    4. Exit the `nano` text editor and save your changes: press **Ctrl+X**, then **Y+Enter**.

    5. Apply the environment variables from the RC file:

       ```bash
       source <file_name>
       ```

       Specify `<file_name>` — the RC file name you [downloaded](/cloud-servers/tools/openstack-cli/configure-openstack-cli.mdx#download-rc-file-for-os) to configure OpenStack CLI. The 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:

       ```bash
       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.
  </TabItem>

  <TabItem value="windows">
    <TabItemLabel>
      Windows
    </TabItemLabel>

    1. Open the CLI.

    2. Add environment variables:

       ```bash
       set OS_AUTH_URL=<url>
       set OS_IDENTITY_API_VERSION=3
       set OS_VOLUME_API_VERSION=3
       set CLIFF_FIT_WIDTH=1
       set OS_PROJECT_DOMAIN_NAME=<account_id>
       set OS_PROJECT_ID=<project_id>
       set OS_TENANT_ID=<project_id>
       set OS_TENANT_NAME=<project_name>
       set OS_REGION_NAME=<pool>
       set OS_USER_DOMAIN_NAME=<account_id>
       set OS_USERNAME=<user_name>
       set OS_PASSWORD=<user_password>
       ```

       Specify:

       * `<url>` — API authorization URL. The address depends on the region and pool; you can view it in the [URL list](/api/urls/);
       * `<account_id>` — account ID. You can view it in the [control panel](https://my.selectel.ru/) in the top-right corner;
       * `<project_id>` — project ID. You can copy it in the [control panel](https://my.selectel.ru/vpc/): from the top menu, click **Products** and select **Cloud Servers** → open the projects menu (the name of the current project) → in the project line, click <CopyIcon />;
       * `<project_name>` — project name. You can view it in the [control panel](https://my.selectel.ru/vpc/): from the top menu, click **Products** and select **Cloud Servers** → open the projects menu (the name of the current project);
       * `<pool>` — [pool](/infrastructure/locations.mdx#pool), for example, `ru-2`;
       * `<user_name>` — name of the service user who has access to resource management. You can view it in the [control panel](https://my.selectel.ru/): from the top menu, click **IAM** → **Service Users** section;
       * `<user_password>` — service user password. After the user is created, you cannot view the password — you can only generate a new one. For details, see the [Change service user password](/access-control/manage/edit-user-data-or-role.mdx#change-service-user-password) subsection of the Managing user data and roles instructions.

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

       ```bash
       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.
  </TabItem>
</Tabs>

### Change authentication credentials in the Docker container \{#edit-authorization-data-in-docker}

1. Open the CLI.

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

   ```bash
   nano /<docker_directory>/<file_name>
   ```

   Specify:

   * `<docker_directory>` — name of the directory where you moved the RC file and Dockerfile;
   * `<file_name>` — the RC file name you [downloaded](/cloud-servers/tools/openstack-cli/configure-openstack-cli.mdx#download-rc-file-for-docker) to configure OpenStack CLI. The default is `rc.sh`.

3. Change the authentication credentials in the file:

   ```bash
   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 ID. You can view it in the [control panel](https://my.selectel.ru/) in the top-right corner;
   * `<project_id>` — project ID. You can copy it in the [control panel](https://my.selectel.ru/vpc/): from the top menu, click **Products** and select **Cloud Servers** → open the projects menu (the name of the current project) → in the project line, click <CopyIcon />;
   * `<pool>` — [pool](/infrastructure/locations.mdx#pool), for example, `ru-2`;
   * `<user_name>` — name of the service user who has access to resource management. You can view it in the [control panel](https://my.selectel.ru/iam/service-users): from the top menu, click **IAM** → **Service Users** section.

4. Exit the `nano` text editor and save your changes: press **Ctrl+X**, then **Y+Enter**.

5. Run the Docker container:

   ```bash
   docker run -ti --rm -v $(pwd):/workspace osc:dalmatian
   ```

6. Apply the environment variables from the RC file:

   ```bash
   source <file_name>
   ```

   Specify `<file_name>` — the RC file name you [downloaded](/cloud-servers/tools/openstack-cli/configure-openstack-cli.mdx#download-rc-file-for-docker) to configure OpenStack CLI. The 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:

   ```bash
   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.

<Formbricks />
