An SSH key pair is used to authenticate with a remote resource over SSH. It consists of:Documentation Index
Fetch the complete documentation index at: https://docs.nebius.com/llms.txt
Use this file to discover all available pages before exploring further.
- A public key that you add to the resource or share with an administrator.
- A private key that you keep on your local machine and use when connecting.
- Configure SSH access when creating a virtual machine (VM) and to connect to your Compute VM over SSH.
- Create a container over VM.
- Give another user access to a VM.
- Connect to login and worker nodes in a Soperator cluster.
- Access a VM through a jump server when the VM does not have a public IP address.
Generating a key pair
-
In the terminal, create the
.sshdirectory if it does not exist: -
Go to the
~/.sshdirectory: -
Generate an SSH key pair:
-
To add a comment that identifies the key, add the optional
-Cparameter:
-
To add a comment that identifies the key, add the optional
-
When prompted, enter the file path where you want to save the key pair.
-
To save the key pair to the default location, press
Enter. -
If you already have a key in the default location, specify a custom file name, for example:
-
To save the key pair to the default location, press
-
(Optional) When prompted, enter a passphrase for the private key.
Press
Enterto generate a key without a passphrase. However, using a passphrase protects the private key if someone gets access to your local machine. - Repeat the passphrase when prompted.
- The private key, for example
~/.ssh/id_ed25519. - The public key, for example
~/.ssh/id_ed25519.pub.
Getting the public key
You need the contents of the public key when a resource or configuration asks for an SSH public key. For example, you can add it to a VM to configure SSH access or send it to an administrator who manages access to the resource. To get the contents of the public key, run:.pub extension:
Protecting the private key
Follow these recommendations when using SSH keys:- Keep the private key only on your local machine and don’t share it with others.
- Share only the public key, which is stored in the file with the
.pubextension. - Use a passphrase for the private key.
- Use a separate key pair for each user.
- Remove public keys that are no longer used from the resource.