Managing SSH Keys

Managing SSH Keys

SSH keys provide secure, passwordless authentication to your Linux VM. You can store multiple keys in your account and manage which ones are used on each server.


Step 1 - Adding SSH Keys to 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. Go to AccountSecurity
  2. Select 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.


Step 2 - Selecting SSH Keys When Creating a VM

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

  1. Open your VDC 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 VM during creation.


Adding SSH Keys to an Existing VM

You can add SSH keys to a VM that is already running - directly from the control panel.

  1. Open the Server Details page of the VM
  2. In the Server Information block, find the SSH Keys row and click the padlock icon (tooltip: Manage SSH Keys)
  3. A panel opens showing two groups:
    • Already installed - keys currently on this VM, shown as read-only badges
    • Available to add - keys from your account that are not yet on this VM, shown as checkboxes
  4. Check the keys you want to add and click Submit

How it works: After you submit your selection, the VM is rebooted to apply the new keys. You will see a notification about the reboot in the control panel.

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 from a running VM, see the instructions below.

How to remove a key from a VM: Connect to the server via SSH and edit the ~/.ssh/authorized_keys file manually, deleting the relevant line:

nano ~/.ssh/authorized_keys

Alternative: Adding SSH Keys Manually via SSH

If you prefer to manage keys manually, you can add them directly inside the operating system:

  1. Connect to your VM using password authentication:
    ssh root@your_server_ip
  2. Create the .ssh directory if it doesn't 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 control panel. They will not be affected when you add keys through the panel.


Was this article helpful?

mood_bad Dislike 0
mood Like 0
visibility Views: 108