Managing registry passwords

For devices and registries to begin exchanging data and commands, you need to log in. This section describes how to manage registry passwords for the relevant authorization method.

Note

When using an X.509 certificate along with a password, the password has higher priority.

Adding a password to a registry

You can add a password to an already created registry or set it when creating a registry using the --password parameter.

Note

You can also set a password from the input stream. To do this, use the --read-password flag instead of the --password parameter.

Adding a password to an already created registry

If you don't have the Yandex.Cloud command line interface yet, install it.

To add a password:

  1. Get a list of registries in the folder:

    $ yc iot registry list
    +----------------------+-------------------+
    |          ID          |       NAME        |
    +----------------------+-------------------+
    | arenou2oj4ct42eq82er | my-registry       |
    +----------------------+-------------------+
    
  2. Add a password to the registry:

    $ yc iot registry password add --registry-name my-registry --password Passw0rdForRegistry
    registry_id: arenou2oj4ct42eq8g3n
    id: areuu2hgsv6klgbd4e6d
    created_at: "2019-12-16T15:32:46.655139Z"
    

Setting a password for a registry when creating it

If you don't have the Yandex.Cloud command line interface yet, install it.

The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name or --folder-id parameter.

Create a registry with a password:

$ yc iot registry create --name registry-with-pass --password Passw0rdForDevice
done (1s)
id: areg96c8loruvvudj54t
folder_id: b1g88tflru0ek1omtfd3
created_at: "2019-12-16T15:34:25.563Z"
name: registry-with-pass
status: ACTIVE
log_group_id: ckghhil3b5o9t4pf1nvg

Getting a list of registry passwords

If you don't have the Yandex.Cloud command line interface yet, install it.

The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name or --folder-id parameter.

To get a list of passwords:

  1. Get a list of registries in the folder:

    $ yc iot registry list
    +----------------------+--------------------+
    |          ID          |        NAME        |
    +----------------------+--------------------+
    | areg96c8loruvvudj54t | registry-with-pass |
    | arenou2oj4ct42eq82er | my-registry        |
    +----------------------+--------------------+
    
  2. Get a list of registry passwords:

    $ yc iot registry password list --registry-name registry-with-pass
    +----------------------+---------------------+
    |          ID          |     CREATED AT      |
    +----------------------+---------------------+
    | are0gffs957egmoksgf4 | 2019-12-16 15:34:25 |
    +----------------------+---------------------+
    

Deleting a registry password

If you don't have the Yandex.Cloud command line interface yet, install it.

The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name or --folder-id parameter.

To delete a password:

  1. Get a list of registry passwords:

    $ yc iot registry password list --registry-name registry-with-pass
    +----------------------+---------------------+
    |          ID          |     CREATED AT      |
    +----------------------+---------------------+
    | are0gffs957egmoksgf4 | 2019-12-16 15:34:25 |
    +----------------------+---------------------+
    
  2. Delete the password:

    $ yc iot registry password delete --registry-name registry-with-pass --password-id are0gffs957egmoksgf4
    
  3. Make sure that the password was deleted:

    $ yc iot registry password list --registry-name registry-with-pass
    +----+------------+
    | ID | CREATED AT |
    +----+------------+
    +----+------------+