Managing SSH Keys

SSH keys provide secure, passwordless authentication to your Linux servers. You can store multiple keys in your account and choose which ones to install on each server.


Storing SSH Keys in Your Account

Your account has a key storage where you can keep all your SSH keys. These keys are not applied to any server automatically – they are simply saved for future use.

  1. In your client portal sidebar, click Security
  2. Open the SSH Keys tab
  3. Click Add new SSH key
  4. Enter a name for the key (e.g. my-laptop, colleague-alex) and paste the public key in OpenSSH format
  5. Click Save

You can add as many keys as you need – for yourself, your colleagues, or your automation tools.


Selecting Keys When Creating a New Server

When you create a new server from your VDC service, you can choose which keys to install on it:

  1. Open your Virtual Data Center service and click Add new server
  2. Choose a cluster and a Linux template
  3. Find the SSH Key section and select one or more keys from your saved keys, or click Add new key to add one on the spot
  4. Complete the rest of the form and click Create

The selected keys will be automatically installed on the server during creation.


Adding Keys to an Existing Server

You can add SSH keys to a server that is already running, directly from the client portal.

  1. Open the server in your client portal
  2. On the Overview tab, find the Server Information section
  3. In the SSH Keys row, click the padlock icon (tooltip: Manage SSH Keys)
  4. A panel opens showing two groups:
    • Already installed – keys currently on this server, shown as read-only badges
    • Available to add – keys from your account that are not yet on this server, shown as checkboxes
  5. Check the keys you want to add and click Submit

What happens next: the server will be rebooted to apply the new keys. You will see a notification about the reboot in the client portal.

Important – how keys are applied:

  • The panel only adds keys. Existing keys on the server are preserved.
  • Removing a key via the panel is not supported. To remove a key, see the section below.

Removing a Key from a Server

To remove an SSH key from a running server, you need to do it manually inside the operating system. Connect to the server via SSH and edit the ~/.ssh/authorized_keys file:

nano ~/.ssh/authorized_keys

Delete the line containing the key you want to remove, save the file, and exit. The change takes effect immediately – the next SSH connection using that key will be refused.


Alternative: Adding Keys Manually via SSH

If you prefer to manage keys manually (or want to add a key without rebooting), you can add them directly inside the operating system:

  1. Connect to your server using password authentication:
    ssh root@your_server_ip
  2. Create the .ssh directory if it does not exist:
    mkdir -p ~/.ssh && chmod 700 ~/.ssh
  3. Add the public key:
    echo "your_public_key_here" >> ~/.ssh/authorized_keys
  4. Set correct permissions:
    chmod 600 ~/.ssh/authorized_keys

Note: Keys added manually inside the OS are not visible in the client portal. They will not be affected when you add keys through the panel.