Skip to main content

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.

An SSH key pair is used to authenticate with a remote resource over SSH. It consists of:
  • 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.
You need an SSH key pair to:

Generating a key pair

  1. In the terminal, create the .ssh directory if it does not exist:
    mkdir -p ~/.ssh
    chmod 700 ~/.ssh
    
  2. Go to the ~/.ssh directory:
    cd ~/.ssh
    
  3. Generate an SSH key pair:
    ssh-keygen -t ed25519
    
    • To add a comment that identifies the key, add the optional -C parameter:
      ssh-keygen -t ed25519 -C "<key_comment>"
      
  4. 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:
      /home/<username>/.ssh/nebius_ed25519
      
  5. (Optional) When prompted, enter a passphrase for the private key. Press Enter to generate a key without a passphrase. However, using a passphrase protects the private key if someone gets access to your local machine.
  6. Repeat the passphrase when prompted.
The command creates two files:
  • 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:
cat ~/.ssh/id_ed25519.pub
If you saved the public key to a custom file when you generated the key, specify the name with the .pub extension:
cat ~/.ssh/<key_file_name>.pub
The output contains the contents of the public key, for example:
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAI*** user@example.com

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 .pub extension.
  • 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.