Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
    • Yandex Cloud Partner program
  • Blog
  • Pricing
  • Documentation
© 2025 Direct Cursus Technology L.L.C.
Yandex IoT Core
    • All guides
    • Sending messages
    • Subscribing a device or registry to receive messages
    • Exporting messages to Data Streams
    • Viewing the connection log
      • Managing registry passwords
      • Managing device passwords
      • Managing broker passwords
    • Viewing operations with the service's resources
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Release notes
  • FAQ

In this article:

  • Adding a password to a device
  • Adding a password to an existing device
  • Setting a password for a device when creating it
  • Getting a list of device passwords
  • Deleting a device password
  1. Step-by-step guides
  2. Managing passwords
  3. Managing device passwords

Managing device passwords

Written by
Yandex Cloud
Updated at May 13, 2025
  • Adding a password to a device
    • Adding a password to an existing device
    • Setting a password for a device when creating it
  • Getting a list of device passwords
  • Deleting a device password

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

Note

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

  • Adding a password
  • Viewing a password list
  • Deleting a password

Adding a password to a deviceAdding a password to a device

You can add a password to an already created device or set it when creating a device 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 existing deviceAdding a password to an existing device

Management console
CLI
Terraform
API

To add a password to an existing device:

  1. In the management console, select the folder where you want to add a password for an existing device.
  2. Select IoT Core.
  3. Select the registry with the required device from the list.
  4. On the left side of the window, select the Devices section.
  5. Select the device from the list.
  6. Under Passwords, click Add password.
  7. In the Password field, enter the password you will use to access the device.
    To create a password, you can use the password generator.
    Make sure to save your password, as you will need it later.
  8. Click Add.

If you do not have the Yandex Cloud (CLI) command line interface yet, install and initialize it.

To add a password:

  1. Get a list of devices in the registry:

    yc iot device --registry-name my-registry list
    

    Result:

    +----------------------+--------+
    |          ID          |  NAME  |
    +----------------------+--------+
    | arenak5ciqss******** | second |
    | areqjd6un3af******** | first  |
    +----------------------+--------+
    
  2. Add a password to the device:

    yc iot device password add --device-name first --password Passw0rdForDevice
    

    Result:

    device_id: areqjd6un3af********
    id: areqjd6un3af********
    created_at: "2019-12-16T15:11:36.892167Z"
    

With Terraform, 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. The Yandex Cloud provider for Terraform is distributed under the MPL-2.0 license.

For more information about the provider resources, see the documentation on the Terraform website or mirror website.

If you do not have Terraform yet, install it and configure its Yandex Cloud provider.

To add a password to a device created using Terraform:

  1. In the configuration file, describe the parameters of the resource to create:

    • yandex_iot_core_registry: Device properties:
      • registry_id: ID of the registry where the device was created.
      • name: Device name.
      • description: Device description.
      • passwords: List of passwords for authorization with login and password.

    Here is an example of the resource structure in the configuration file:

    resource "yandex_iot_core_device" "my_device" {
      registry_id = "<registry_ID>"
      name        = "<device_name>"
      description = "test device for terraform provider documentation"
    ...
      passwords = [
        "<password>",
      ]
    ...
    }
    

    For more information about the yandex_iot_core_device resource parameters in Terraform, see the relevant provider documentation.

  2. In the command line, change to the folder where you edited the configuration file.

  3. Make sure the configuration file is correct using this command:

    terraform validate
    

    If the configuration is correct, you will get this message:

    Success! The configuration is valid.
    
  4. Run this command:

    terraform plan
    

    The terminal will display a list of resources with parameters. No changes will be made at this step. If the configuration contains any errors, Terraform will point them out.

  5. Apply the configuration changes:

    terraform apply
    
  6. Confirm the changes: type yes into the terminal and press Enter.

    You can verify device passwords in the management console or using the following CLI command:

    yc iot device password list --device-name <device_name>
    

To add a password to a device, use the addPassword REST API method for the Device resource or the DeviceService/AddPassword gRPC API call.

Setting a password for a device when creating itSetting a password for a device when creating it

Management console
CLI
Terraform
API

For information about how to set a password for a device when creating it, see Creating a device.

If you do not have the Yandex Cloud (CLI) command line interface yet, install and initialize it.

The folder specified when creating the CLI profile is used by default. To change the default folder, use the yc config set folder-id <folder_ID> command. You can specify a different folder using the --folder-name or --folder-id parameter.

To set a password when creating a device:

  1. Get a list of registries in the folder:

    yc iot registry list
    

    Result:

    +----------------------+-------------------+
    |          ID          |       NAME        |
    +----------------------+-------------------+
    | arenou2oj4ct******** | my-registry       |
    +----------------------+-------------------+
    
  2. Create a device with a password:

    yc iot device create --registry-name my-registry --name device-with-pass --password Passw0rdForDevice
    

    Result:

    id: arepomfambsg********
    registry_id: arenou2oj4ct********
    created_at: "2019-12-16T15:18:39.358922Z"
    name: device-with-pass
    

For information about how to set a password for a device when creating it, see Creating a device.

To set a password for a device when creating it, use the create REST API method for the Device resource or the DeviceService/Create gRPC API call.

Getting a list of device passwordsGetting a list of device passwords

Management console
CLI
API

To view the list of device passwords:

  1. In the management console, select the folder to get the list of device passwords for.
  2. Select IoT Core.
  3. Select the registry with the required device from the list.
  4. On the left side of the window, select the Devices section.
  5. Select the device from the list.
  6. On the Overview page, go to the Passwords section.

The list of device passwords will be displayed in the Passwords section.

If you do not have the Yandex Cloud (CLI) command line interface yet, install and initialize it.

The folder specified when creating the CLI profile is used by default. To change the default folder, use the yc config set folder-id <folder_ID> command. 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 devices in the registry:

    yc iot device --registry-name my-registry list
    

    Result:

    +----------------------+------------------+
    |          ID          |       NAME       |
    +----------------------+------------------+
    | arenak5ciqss******** | second           |
    | arepomfambsg******** | device-with-pass |
    | areqjd6un3af******** | first            |
    +----------------------+------------------+
    
  2. Get a list of device passwords:

    yc iot device password list --device-name device-with-pass
    

    Result:

    +----------------------+---------------------+
    |          ID          |     CREATED AT      |
    +----------------------+---------------------+
    | areuin5t7pnd******** | 2019-12-16 15:18:39 |
    +----------------------+---------------------+
    

To get a list of device passwords, use the listPasswords REST API method for the Device resource or the DeviceService/ListPasswords gRPC API call.

Deleting a device passwordDeleting a device password

Management console
CLI
Terraform
API

To delete a device password:

  1. In the management console, select the folder to delete a device password from.
  2. Select IoT Core.
  3. Select the registry with the required device from the list.
  4. On the left side of the window, select the Devices section.
  5. Select the device from the list.
  6. In the row with the password, click and select Delete from the drop-down list.
  7. In the window that opens, click Delete.

If you do not have the Yandex Cloud (CLI) command line interface yet, install and initialize it.

The folder specified when creating the CLI profile is used by default. To change the default folder, use the yc config set folder-id <folder_ID> command. You can specify a different folder using the --folder-name or --folder-id parameter.

To delete a password:

  1. Get a list of device passwords:

    yc iot device password list --device-name device-with-pass
    

    Result:

    +----------------------+---------------------+
    |          ID          |     CREATED AT      |
    +----------------------+---------------------+
    | areuin5t7pnd******** | 2019-12-16 15:18:39 |
    +----------------------+---------------------+
    
  2. Delete the password:

    yc iot device password delete --device-name device-with-pass --password-id areuin5t7pnd********
    
  3. Make sure that the password was deleted:

    yc iot device password list --device-name device-with-pass
    

    Result:

    +----+------------+
    | ID | CREATED AT |
    +----+------------+
    +----+------------+
    

With Terraform, 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. The Yandex Cloud provider for Terraform is distributed under the MPL-2.0 license.

For more information about the provider resources, see the documentation on the Terraform website or mirror website.

If you do not have Terraform yet, install it and configure its Yandex Cloud provider.

To delete the password of a device created using Terraform:

  1. Open the Terraform configuration file and delete the password value in the passwords section, in the device description fragment. To delete all passwords, delete the entire passwords section.

    Example device description in the Terraform configuration:

    resource "yandex_iot_core_device" "my_device" {
      registry_id = "<registry_ID>"
      name        = "<device_name>"
      description = "test device for terraform provider documentation"
    ...
      passwords = [
        "<password>",
      ]
    ...
    }
    

    For more information about the yandex_iot_core_device resource parameters in Terraform, see the relevant provider documentation.

  2. In the command line, change to the folder where you edited the configuration file.

  3. Make sure the configuration file is correct using this command:

    terraform validate
    

    If the configuration is correct, you will get this message:

    Success! The configuration is valid.
    
  4. Run this command:

    terraform plan
    

    The terminal will display a list of resources with parameters. No changes will be made at this step. If the configuration contains any errors, Terraform will point them out.

  5. Apply the configuration changes:

    terraform apply
    
  6. Confirm the changes: type yes into the terminal and press Enter.

    You can verify device passwords in the management console or using the following CLI command:

    yc iot device password list --device-name <device_name>
    

To delete a device password, use the deletePassword REST API method for the Device resource or the DeviceService/DeletePassword gRPC API call.

Was the article helpful?

Previous
Managing registry passwords
Next
Managing broker passwords
© 2025 Direct Cursus Technology L.L.C.