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
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
  • Blog
  • Pricing
  • Documentation
Yandex project
© 2025 Yandex.Cloud LLC
Yandex Compute Cloud
  • Yandex Container Solution
    • Resource relationships
      • Overview
      • Metadata folders
      • Keys processed in public images
      • Transferring data to a VM instance
      • Accessing metadata
      • Identity document
    • Graphics processing units (GPUs)
    • Images
    • Dedicated host
    • Encryption
    • Backups
    • Quotas and limits
  • Access management
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Release notes
  1. Concepts
  2. VM instance metadata
  3. Keys processed in public images

Keys processed in public images Yandex Cloud

Written by
Yandex Cloud
Updated at April 18, 2025

The list of keys processed by the metadata service in Yandex Cloud public images depends on the image OS:

Linux
Windows
  • serial-port-enable: Key responsible for access to serial console of the VM instance: The possible values are:

    • 0: Access to serial console disabled. Default value.
    • 1: Access to serial console enabled.
  • enable-oslogin: Key responsible for access to the VM instance via OS Login. The possible values are:

    • false: Access via OS Login disabled. Default value.
    • true: Access via OS Login enabled.
  • user-data: Key containing a string with the user metadata that will be processed by the cloud-init agent running on the VM instance.

    Cloud-init supports different metadata transmission formats, e.g., cloud-config. In this format, you can provide SSH keys and indicate which user each key is associated with. To do this, specify them in the users/ssh_authorized_keys section:

    #cloud-config
    users:
      - name: <username>
        groups: sudo
        shell: /bin/bash
        sudo: 'ALL=(ALL) NOPASSWD:ALL'
        ssh_authorized_keys:
          - <public_SSH_key_1>
          - <public_SSH_key_2>
          - ...
    

    Where:

    • name: VM user name.

    • ssh_authorized_keys: List of public SSH keys for VM access.

      Key example: ssh-ed25519 AAAAB3Nza...Pu00jRN.

    To provide this data in the request, replace line breaks with \n:

    "metadata": {
      "user-data": "#cloud-config\nusers:\n  - name: user\n    groups: sudo\n    shell: /bin/bash\n    sudo: 'ALL=(ALL) NOPASSWD:ALL'\n    ssh_authorized_keys:\n      - ssh-ed25519 AAAAB3Nza......OjbSMRX user@example.com\n      - ssh-ed25519 AAAAB3Nza...Pu00jRN"
    }
    

    In the user-data key, you may also describe the software installation scripts you want executed when creating a new VM instance and provide to the VM instance the Yandex Lockbox secrets and variables whose values you can later get from within the VM instance.

  • ssh-keys: Key responsible for delivering a public SSH key to the Linux VM instance via Terraform. Use this format: <username>:<SSH_key_contents>, e.g., user:ssh-ed25519 AAAAB3Nza...Pu00jRN. If you specify multiple keys, only the first one will be used.

user-data: Key containing a string with user metadata to be processed by the Cloudbase-Init agent. This agent supports various data formats, such as PowerShell scripts that set the administrator password:

"metadata": {
  "user-data": "#ps1\nnet user Administrator Passw0rd"
}

Use casesUse cases

  • Deploying Remote Desktop Gateway
  • Creating a VM and an instance group from a Container Optimized Image using Terraform
  • Linking a Yandex Cloud Backup policy to a VM automatically
  • Connecting resources from different folders
  • Running a Docker image on a VM

See alsoSee also

  • VM metadata
  • Metadata folders
  • Transferring metadata to VM instances
  • Access to VM instance metadata
  • Identity document

Was the article helpful?

Previous
Metadata folders
Next
Transferring data to a VM instance
Yandex project
© 2025 Yandex.Cloud LLC