Working with a VM based on a public image

Connecting via SSH

The recommended method for connecting to a virtual machine over SSH is based on using a key pair: the open key is placed on the virtual machine, and the private key is stored on the user's device. Connecting with a key pair is more secure than connecting with a username and password.

Note

In public Linux images provided by Yandex.Cloud, the ability to connect via SSH using login and password is disabled by default.

You can connect to the virtual machine over SSH when it starts. You can use the ssh tool on Linux and macOS and PuTTy for Windows. Don't forget to set up the created key pair: the private key must match the public key sent to the VM.

To connect, you have to specify the address of the VM. This can be its IP address or the FQDN. Access via FQDN is possible from another Yandex.Cloud VM, if it is connected to the same virtual network. You can find out the IP address in the management console. Go to the Network section on the virtual machine's page.

Connecting using your login and password

You can connect to a VM with your login and password when it is started.

Note

In public Linux images provided by Yandex.Cloud, the ability to connect via SSH using login and password is disabled by default.

To get logins and passwords for VMs based on public images, use the following command:

$ sudo cat /root/default_passwords.txt

If password authentication is not supported, there won't be a file with passwords.

Using SSL

To use SSL, generate an SSL certificate yourself and configure the web server to work with it.

Filtering network traffic

On public image-based VMs, only those ports are open which are required for the configuration and operation of the pre-installed software.

You can view a list of open ports for a particular VM when connecting to it via SSH. To open additional ports, use the iptables utility.

Installing updates

On public image-based VMs, the OS and software are not updated automatically. You can update them on your own.