[Yandex Cloud documentation](../../index.md) > [Yandex Managed Service for Valkey™](../index.md) > [Step-by-step guides](index.md) > Users > Getting user info

# Getting user info

Yandex Managed Service for Valkey™ can create Valkey™ users and configure their permissions for commands, keys, and Pub/Sub channels in the cluster using [Valkey™ access control lists](https://valkey.io/topics/acl) (ACLs).

Valkey™ ACLs address two primary objectives:

* Ensure security by enforcing fine-grained access to commands and keys.
* Prevent accidental errors caused by user actions or software failures.

Creating a cluster automatically creates a `default` user. This user can access all keys and Pub/Sub channels in the cluster and can run all commands except administrative ones. You can view the user’s detailed permissions in the [user info](user-list.md#get).

## Getting a list of users {#list}

{% list tabs group=instructions %}

- Management console {#console}

  1. In the [management console](https://console.yandex.cloud), select the folder containing the cluster.
  1. [Navigate to](../../console/operations/select-service.md#select-service) **Yandex Managed Service for&nbsp;Valkey™**.
  1. Click the name of your cluster and select the ![image](../../_assets/console-icons/persons.svg) **Users** tab.

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

  To get a list of users:

  1. See the description of the CLI command for getting a list of users:

      ```bash
      yc managed-redis user list --help
      ```
  
  1. Get the list of users by running this command:

      ```bash
      yc managed-redis user list \
        --cluster-id=<cluster_ID> 
      ```

      Where `--cluster-id` is the cluster ID.

      You can get the cluster ID with the [list of clusters](cluster-list.md#list-clusters) in the folder.

- REST API {#api}
    
  1. [Get an IAM token for API authentication](../api-ref/authentication.md) and put it into an environment variable:

      ```bash
      export IAM_TOKEN="<IAM_token>"
      ```

  1. Call the [User.List](../api-ref/User/list.md) method, e.g., via the following [cURL](https://curl.se/) request:

      ```bash
      curl \
        --request GET \
        --header "Authorization: Bearer $IAM_TOKEN" \
        --url 'https://mdb.api.cloud.yandex.net/managed-redis/v1/clusters/<cluster_ID>/users'
      ```

      You can get the cluster ID with the [list of clusters](cluster-list.md#list-clusters) in the folder.

  1. Check the [server response](../api-ref/User/list.md#yandex.cloud.mdb.redis.v1.ListUsersResponse) to make sure your request was successful.

- gRPC API {#grpc-api}

  1. [Get an IAM token for API authentication](../api-ref/authentication.md) and put it into an environment variable:

      ```bash
      export IAM_TOKEN="<IAM_token>"
      ```

  1. Clone the [cloudapi](https://github.com/yandex-cloud/cloudapi) repository:
     
     ```bash
     cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
     ```
     
     Below, we assume that the repository contents reside in the `~/cloudapi/` directory.

  1. Call the [UserService.List](../api-ref/grpc/User/list.md) method, e.g., via the following [gRPCurl](https://github.com/fullstorydev/grpcurl) request:

      ```bash
      grpcurl \
        -format json \
        -import-path ~/cloudapi/ \
        -import-path ~/cloudapi/third_party/googleapis/ \
        -proto ~/cloudapi/yandex/cloud/mdb/redis/v1/user_service.proto \
        -rpc-header "Authorization: Bearer $IAM_TOKEN" \
        -d '{
          "cluster_id": "<cluster_ID>"
        }' \
        mdb.api.cloud.yandex.net:443 \
        yandex.cloud.mdb.redis.v1.UserService.List
        ```
    
      Where `cluster_id` is the cluster ID.
      
      You can get the cluster ID with the [list of clusters](cluster-list.md#list-clusters) in the folder.  

  1. Check the [server response](../api-ref/grpc/User/list.md#yandex.cloud.mdb.redis.v1.ListUsersResponse) to make sure your request was successful.

{% endlist %}

## Getting user info {#get}

{% list tabs group=instructions %}

- Management console {#console}

  1. In the [management console](https://console.yandex.cloud), select the folder containing the cluster.
  1. [Navigate to](../../console/operations/select-service.md#select-service) **Yandex Managed Service for&nbsp;Valkey™**.
  1. Click the name of your cluster and select the ![image](../../_assets/console-icons/persons.svg) **Users** tab.
      
      User information is available in the user list.
  
- 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.

  To get information about a specific user:

  1. See the description of the CLI command for getting user info:

      ```bash
      yc managed-redis user get --help
      ```
  
  1. Get user info by running this command:

      ```bash
      yc managed-redis user get <username> \
        --cluster-id=<cluster_ID>
      ```

      Where `--cluster-id` is the cluster ID. You can get the cluster ID with the [list of clusters](cluster-list.md#list-clusters) in the folder.

      You can get the username with the [list of users](#list) in the cluster.

- REST API {#api}
  
  1. [Get an IAM token for API authentication](../api-ref/authentication.md) and put it into an environment variable:

      ```bash
      export IAM_TOKEN="<IAM_token>"
      ```

  1. Call the [User.Get](../api-ref/User/get.md) method, e.g., via the following [cURL](https://curl.se/) request:

      ```bash
      curl \
        --request GET \
        --header "Authorization: Bearer $IAM_TOKEN" \
        --url 'https://mdb.api.cloud.yandex.net/managed-redis/v1/clusters/<cluster_ID>/users/<username>'
      ```

      You can get the cluster ID with the [list of clusters](cluster-list.md#list-clusters) in the folder.

      You can get the username with the [list of users](#list) in the cluster.

  1. Check the [server response](../api-ref/User/get.md#yandex.cloud.mdb.redis.v1.User) to make sure your request was successful.

- gRPC API {#grpc-api}

  1. [Get an IAM token for API authentication](../api-ref/authentication.md) and put it into an environment variable:

      ```bash
      export IAM_TOKEN="<IAM_token>"
      ```

  1. Clone the [cloudapi](https://github.com/yandex-cloud/cloudapi) repository:
     
     ```bash
     cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
     ```
     
     Below, we assume that the repository contents reside in the `~/cloudapi/` directory.

  1. Call the [UserService.Get](../api-ref/grpc/User/get.md) method, e.g., via the following [gRPCurl](https://github.com/fullstorydev/grpcurl) request:

      ```bash
      grpcurl \
        -format json \
        -import-path ~/cloudapi/ \
        -import-path ~/cloudapi/third_party/googleapis/ \
        -proto ~/cloudapi/yandex/cloud/mdb/redis/v1/user_service.proto \
        -rpc-header "Authorization: Bearer $IAM_TOKEN" \
        -d '{
          "cluster_id": "<cluster_ID>",
          "user_name": "<username>"
        }' \
        mdb.api.cloud.yandex.net:443 \
        yandex.cloud.mdb.redis.v1.UserService.Get
        ```
      
      Where:

      * `cluster_id`: Cluster ID.
        
        You can get the cluster ID with the [list of clusters](cluster-list.md#list-clusters) in the folder.

      * `user_name`: Username.
      
        You can get the username with the [list of users](#list) in the cluster.  

  1. Check the [server response](../api-ref/grpc/User/get.md#yandex.cloud.mdb.redis.v1.User) to make sure your request was successful.

{% endlist %}