Setting up OS Login access on an existing VM
Written by
Updated at March 28, 2024
If you need to set up a connection to a deployed VM via OS Login, you can install the OS Login agent on the VM yourself.
To set up OS Login access to an existing VM:
-
Enable access via OS Login at the organization level.
-
Connect to the VM over SSH.
-
Install the OS Login agent on the VM. Depending on the VM's OS, run one of the following commands:
Ubuntu 22.04Ubuntu 20.04Ubuntu 18.04CentOS 7Debian 11curl https://storage.yandexcloud.net/oslogin-configs/ubuntu-22.04/config_oslogin.sh | bash
curl https://storage.yandexcloud.net/oslogin-configs/ubuntu-20.04/config_oslogin.sh | bash
curl https://storage.yandexcloud.net/oslogin-configs/ubuntu-18.04/config_oslogin.sh | bash
curl https://storage.yandexcloud.net/oslogin-configs/centos-7/config_oslogin.sh | bash
curl https://storage.yandexcloud.net/oslogin-configs/debian-11/config_oslogin.sh | bash
-
Enable access via OS Login on the VM.
Now you can connect to your VM via OS Login 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.
To be able to connect to the VM over SSH without using OS Login, update the VM settings by disabling Access by OS Login.