[Yandex Cloud documentation](../../../index.md) > [Yandex Identity Hub](../../index.md) > [Step-by-step guides](../index.md) > Managing users > Changing a local user password

# Updating a local user password


{% note info %}

This guide requires you to use the [CLI](../../../cli/index.md) if one or more of the following conditions are true:
* The **Block users from viewing the list of organization members and their details** option is [enabled](../hide-user-info.md) in the organization's settings.
* The `organization.denyUserListing` [access policy](../../../iam/concepts/access-control/access-policies.md) applies, which prohibits viewing the organization's user list.

{% endnote %}

## Resetting a password {#reset}

To reset a [local](../../../iam/concepts/users/accounts.md#local) user password, do the following:

{% list tabs group=instructions %}

- Cloud Center UI {#cloud-center}

  1. Log in to [Yandex Identity Hub](https://center.yandex.cloud/organization) using an administrator or organization owner account.
  1. In the left-hand panel, select ![icon-users](../../../_assets/console-icons/person.svg) **Users** and find the local user.

      Optionally, use the search bar or filter at the top of the page.
  1. In the row with the user, click ![icon-context-menu](../../../_assets/console-icons/ellipsis.svg) and select ![key](../../../_assets/console-icons/key.svg) **Reset password**.
  1. In the window that opens, confirm resetting the password.

      Save the generated password and communicate it to the user. After closing the window, you will not be able to view the new password.

- CLI {#cli}

  If you do not have the Yandex Cloud CLI yet, [install and initialize it](../../../cli/quickstart.md#install).

  The folder used by default is the one specified when [creating](../../../cli/operations/profile/profile-create.md) the CLI profile. To change the default folder, use the `yc config set folder-id <folder_ID>` command. You can also specify a different folder for any command using `--folder-name` or `--folder-id`. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.

  1. See the description of the CLI command for resetting a user password in a [pool](../../concepts/user-pools.md):

     ```bash
     yc organization-manager idp user reset-password --help
     ```
  1. To get a list of pools in an organization, provide its [ID](../organization-get-id.md) in this command:
     
     ```bash
     yc organization-manager idp userpool list \
       --organization-id <organization_ID>
     ```
     
     Result:
     
     ```text
     +----------------------+--------------+-------------+----------------------+---------------------+
     |          ID          |     NAME     | DESCRIPTION |   ORGANIZATION ID    |     CREATED AT      |
     +----------------------+--------------+-------------+----------------------+---------------------+
     | ek0o6g0irskn******** | sample-pool1 |             | bpf2c65rqcl8******** | 2025-05-17 10:01:04 |
     | ek03mf01jr4z******** | sample-pool2 |             | bpf2c65rqcl8******** | 2025-06-28 16:30:23 |
     +----------------------+--------------+-------------+----------------------+---------------------+
     ```
  1. To get the IDs and other information about pool users, provide the pool ID in the following command:
     
     ```bash
     yc organization-manager idp user list \
       --userpool-id <user_pool_ID>
     ```
     
     Result:
     
     ```text
     +----------------------+----------------------------------------+-----------+----------------------+-----------+---------------------+
     |          ID          |                USERNAME                | FULL NAME |     USERPOOL ID      | IS ACTIVE |     CREATED AT      |
     +----------------------+----------------------------------------+-----------+----------------------+-----------+---------------------+
     | aje3i1gq49n3******** | test-user1@test.ru.idp.yandexcloud.net | User 1    | ek0o6g0irskn******** | true      | 2025-10-07 10:41:54 |
     | aje0j5mts02t******** | test-user2@test.ru.idp.yandexcloud.net | User 2    | ek0o6g0irskn******** | false     | 2025-07-16 11:18:57 |
     +----------------------+----------------------------------------+-----------+----------------------+-----------+---------------------+
     ```
  1. Run the command, specifying the user ID:

      ```bash
      yc organization-manager idp user reset-password <user_ID>
      ```

      Result:

      ```text
      generated password for user 'ek0gkfu0jc7v********' is 'rhls-mpvg-****-****'
      ```

      Save the generated password and communicate it to the user. After closing the shell, you will not be able to view the new password.

- API {#api}

  Use the [User.GeneratePassword](../../idp/api-ref/User/generatePassword.md) REST API method for the [User](../../idp/api-ref/User/index.md) resource or the [UserService/GeneratePassword](../../idp/api-ref/grpc/User/generatePassword.md) gRPC API call.

{% endlist %}

The user must change this password on their first login to Yandex Cloud.

{% note info %}

If a [password policy](../../concepts/password-policy.md) is configured for a user pool, it will not apply to automatically generated passwords.

{% endnote %}

## Setting a password {#set}

{% list tabs group=instructions %}

- Cloud Center UI {#cloud-center}

  You cannot generate a random password for a local user via the Cloud Center interface. To change the password to a generated one, follow [this guide](#reset).

- CLI {#cli}

  If you do not have the Yandex Cloud CLI yet, [install and initialize it](../../../cli/quickstart.md#install).

  The folder used by default is the one specified when [creating](../../../cli/operations/profile/profile-create.md) the CLI profile. To change the default folder, use the `yc config set folder-id <folder_ID>` command. You can also specify a different folder for any command using `--folder-name` or `--folder-id`. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.

  1. View the description of the CLI command for changing a user password in a pool:

     ```bash
     yc organization-manager idp user set-password --help
     ```
  1. To get a list of pools in an organization, provide its [ID](../organization-get-id.md) in this command:
     
     ```bash
     yc organization-manager idp userpool list \
       --organization-id <organization_ID>
     ```
     
     Result:
     
     ```text
     +----------------------+--------------+-------------+----------------------+---------------------+
     |          ID          |     NAME     | DESCRIPTION |   ORGANIZATION ID    |     CREATED AT      |
     +----------------------+--------------+-------------+----------------------+---------------------+
     | ek0o6g0irskn******** | sample-pool1 |             | bpf2c65rqcl8******** | 2025-05-17 10:01:04 |
     | ek03mf01jr4z******** | sample-pool2 |             | bpf2c65rqcl8******** | 2025-06-28 16:30:23 |
     +----------------------+--------------+-------------+----------------------+---------------------+
     ```
  1. To get the IDs and other information about pool users, provide the pool ID in the following command:
     
     ```bash
     yc organization-manager idp user list \
       --userpool-id <user_pool_ID>
     ```
     
     Result:
     
     ```text
     +----------------------+----------------------------------------+-----------+----------------------+-----------+---------------------+
     |          ID          |                USERNAME                | FULL NAME |     USERPOOL ID      | IS ACTIVE |     CREATED AT      |
     +----------------------+----------------------------------------+-----------+----------------------+-----------+---------------------+
     | aje3i1gq49n3******** | test-user1@test.ru.idp.yandexcloud.net | User 1    | ek0o6g0irskn******** | true      | 2025-10-07 10:41:54 |
     | aje0j5mts02t******** | test-user2@test.ru.idp.yandexcloud.net | User 2    | ek0o6g0irskn******** | false     | 2025-07-16 11:18:57 |
     +----------------------+----------------------------------------+-----------+----------------------+-----------+---------------------+
     ```
  1. Run this command, specifying the user ID and their new password in the `--password` parameter:

      ```bash
      yc organization-manager idp user set-password <user_ID> \
        --password <new_password>
      ```

      {% note info %}

      The new password must comply with the user pool's [password policy](../../concepts/password-policy.md).

      {% endnote %}

- Terraform {#tf}

  With [Terraform](https://www.terraform.io/), you can quickly create a cloud infrastructure in Yandex Cloud and manage it using configuration files. These files store the infrastructure description written in HashiCorp Configuration Language (HCL). If you change the configuration files, Terraform automatically detects which part of your configuration is already deployed, and what should be added or removed.
  
  Terraform is distributed under the [Business Source License](https://github.com/hashicorp/terraform/blob/main/LICENSE). The [Yandex Cloud provider for Terraform](https://github.com/yandex-cloud/terraform-provider-yandex) is distributed under the [MPL-2.0](https://www.mozilla.org/en-US/MPL/2.0/) license.
  
  For more information about the provider resources, see the guides on the [Terraform](https://www.terraform.io/docs/providers/yandex/index.html) website or [its mirror](../../../terraform/index.md).

  If you do not have Terraform yet, [install it and configure the Yandex Cloud provider](../../../tutorials/infrastructure-management/terraform-quickstart.md#install-terraform).
  
  
  To manage infrastructure using Terraform under a service account or user accounts (a Yandex account, a federated account, or a local user), [authenticate](../../../terraform/authentication.md) using the appropriate method.

  1. Describe the user parameters in the configuration file:

     ```hcl
     resource "yandex_organizationmanager_idp_user" "example_user" {
       userpool_id = "<pool_ID>"
       username    = "<username>"
       full_name   = "<full_username>"
       password_spec = {
         password = "<new_password>"
       }
     }
     ```

     Where:

     * `userpool_id`: ID of the [pool](../../concepts/user-pools.md) the user is in.
     * `username`: Username.
     * `full_name`: User’s full name.
     * `password`: New user password.

     {% note info %}

     The new password must comply with the user pool's [password policy](../../concepts/password-policy.md).

     {% endnote %}

     For more on the properties of the `yandex_organizationmanager_idp_user` resource, see [this provider guide](../../../terraform/resources/organizationmanager_idp_user.md).

  1. Apply the changes:

     1. In the terminal, navigate to the configuration file directory.
     1. Make sure the configuration is correct using this command:
     
        ```bash
        terraform validate
        ```
     
        If the configuration is valid, you will get this message:
     
        ```bash
        Success! The configuration is valid.
        ```
     
     1. Run this command:
     
        ```bash
        terraform plan
        ```
     
        You will see a list of resources and their properties. No changes will be made at this step. Terraform will show any errors in the configuration.
     1. Apply the configuration changes:
     
        ```bash
        terraform apply
        ```
     
     1. Type `yes` and press **Enter** to confirm the changes.

     Terraform will update all the required resources. You can check the updates using the [Cloud Center UI](https://center.yandex.cloud/organization).

- API {#api}

  Use the [User.SetOwnPassword](../../idp/api-ref/User/setOwnPassword.md) REST API method for the [User](../../idp/api-ref/User/index.md) resource or the [UserService/SetOwnPassword](../../idp/api-ref/grpc/User/setOwnPassword.md) gRPC API call.

{% endlist %}