Creating a VM with OS Login
OS Login is used to provide users with SSH access to VMs through IAM. To grant access to a VM that supports OS Login at the OS level, assign a user the compute.osLogin
or compute.osAdminLogin
role.
You can connect to a VM with OS Login access enabled using an SSH certificate over the YC CLI or a standard SSH client, as well as over the YC CLI using an SSH key previously added to the organization user profile in Yandex Cloud Organization.
However, we recommend specifying SSH keys when creating a VM: this way, you can connect to a VM over SSH if you disable OS Login access for it. You can provide SSH keys to a VM using metadata.
-
Enable access via OS Login at the organization level.
-
Create a VM from the prepared image supporting access via OS Login. These images are available on Yandex Cloud Marketplace and contain
OS Login
in their names.Enable Access by OS Login when creating a VM.
After the created VM changes its status to Running
, you will be able to connect to it via OS Login.
To be able to connect to the VM over SSH without using OS Login, update the VM settings by disabling Access by OS Login.