Working with a VM based on a public image
Connecting via SSH
The recommended method for connecting to a VM over SSH is based on using a key pair: the public key is placed on the VM, while the private one is stored on the user's device. Connecting with a key pair is more secure than doing so with a username and password.
Note
SSH connections using a login and password are disabled by default on public Linux images that are provided by Nebius Israel.
Creating an SSH key pair
To connect to a VM over SSH, you need a key pair: the public key is placed on the VM, while the private one is stored on the user's device. This method is more secure than connecting with a username and password.
Note
SSH connections using a login and password are disabled by default on public Linux images that are provided by Nebius Israel.
To create a key pair:
-
Open the terminal.
-
Use the
ssh-keygen
command to create a new key:ssh-keygen -t ed25519
After you run the command, you will be asked to specify the names of files where the keys will be saved and enter the password for the private key. Press Enter to use the default name (
id_ed25519
). The key pair will be created in the~/.ssh
directory.The public key will be saved in the
<key_name>.pub
file.
If you do not have OpenSSH
-
Run
cmd.exe
orpowershell.exe
(make sure to update PowerShell first). -
Use the
ssh-keygen
command to create a new key. Run this command:ssh-keygen -t ed25519
After you run the command, you will be asked to specify the names of files where the keys will be saved and enter the password for the private key. Press Enter to use the default name (
id_ed25519
).The key pair will be created in
C:\Users\<username>\.ssh\
orC:\Users\<username>\
depending on the command line interface.The public key will be saved in the
<key_name>.pub
file.
To create keys for Windows, use the PuTTY application.
-
Download
and install PuTTY. -
Make sure that the directory where you installed PuTTY is included in
PATH
:- Right-click My computer. Click Properties.
- In the window that opens, select Additional system parameters, then Environment variables (located in the lower part of the window).
- Under System variables, find
PATH
and click Edit. - In the Variable value field, append the path to the directory where you installed PuTTY.
-
Launch the PuTTYgen app.
-
Select EdDSA as the pair type to generate. Click Generate and move the cursor in the field above it until key creation is complete.
-
In Key passphrase, enter a strong password. Enter it again in the field below.
-
Click Save private key and save the private key. Never share it with anyone and do not tell anyone the passphrase for it.
-
Save the key to a text file. To do this, copy the single-line public key from the text field to a text file named
id_ed25519.pub
.
Connecting to a VM
You can connect to a VM over SSH once it is started (i.e., has the RUNNING
status). You can use the ssh
utility in Linux or macOS, or PuTTY
To connect, specify the VM address. This can be either its IP address or FQDN. You can also connect from another Nebius Israel using FQDN if this VM is connected to the same virtual network. You can find out the IP address in the management console
Connecting using your login and password
You can connect to a VM with your login and password when it is started.
Note
SSH connections using a login and password are disabled by default on public Linux images that are provided by Nebius Israel.
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 over SSH. To open additional ports, use the iptables
utility.
Install updates
On public image-based VMs, the OS and software are not updated automatically. You can update them on your own.