[Yandex Cloud documentation](../../../index.md) > [Yandex Compute Cloud](../../index.md) > [Concepts](../index.md) > VM instance metadata > Keys processed in public images

# Keys processed in public images Yandex Cloud

The list of keys processed by the [metadata service](../vm-metadata.md) in Yandex Cloud [public images](../image.md) depends on the image OS:

{% list tabs group=operating_system %}

- Linux {#linux}

  * `serial-port-enable`: Key responsible for access to [serial console](../serial-console.md) of the VM instance: The possible values are:
      * `0`: Access to serial console disabled. This is a default value.
      * `1`: Access to serial console enabled.
  * `enable-oslogin`: Key responsible for access to the VM instance via [OS Login](../../operations/vm-connect/os-login.md). The possible values are:
      * `false`: Access via OS Login disabled. This is a 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](https://cloudinit.readthedocs.io/en/latest/index.html) agent running on the VM instance.

      Cloud-init supports different metadata transmission [formats](https://cloudinit.readthedocs.io/en/latest/topics/format.html), e.g., [cloud-config](https://cloudinit.readthedocs.io/en/latest/topics/examples.html). 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:

      ```bash
         #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`:

      ```json
      "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](../../operations/vm-create/create-with-cloud-init-scripts.md#examples) you want executed when creating a new VM instance and [provide](../../operations/vm-create/create-with-lockbox-secret.md) to the VM instance the [Yandex Lockbox secrets](../../../lockbox/concepts/secret.md) and variables whose values you can later [get](accessing-metadata.md#internal-access) 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.

- Windows {#windows}

  `user-data`: Key containing a string with user metadata to be processed by the [Cloudbase-Init](https://cloudbase.it/cloudbase-init/) agent. This agent supports various [data formats](https://cloudbase-init.readthedocs.io/en/latest/userdata.html), such as PowerShell scripts that set the administrator password:

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

{% endlist %}

## Use cases {#examples}

* [Deploying Remote Desktop Gateway](../../tutorials/rds-gw.md)
* [Creating a VM and an instance group from a Container Optimized Image using Terraform](../../tutorials/coi-with-terraform.md)
* [Associating a Yandex Cloud Backup policy to a VM automatically](../../../tutorials/archive/vm-with-backup-policy/index.md)
* [Setting up networking between resources from different folders](../../../tutorials/routing/multi-folder-vpc.md)
* [Running a Docker image on a VM](../../../tutorials/infrastructure-management/run-docker-on-vm/index.md)

#### Useful links {#see-also}

* [VM metadata](../vm-metadata.md)
* [Metadata folders](directories.md)
* [Transferring metadata to VM instances](sending-metadata.md)
* [Access to VM instance metadata](accessing-metadata.md)
* [Identity document](identity-document.md)