WHAT ARE SSH KEYS AND HOW CAN I USE THEM?

Note: SSH keys are supported only for Linux/*BSD VMs.

SSH keys are a common way to connect securely to remote machines. They are based on the SSH cryptographic network protocol, which is responsible for the encryption of the information stream between you and the remote machine. Ultimately, using SSH keys, you can connect to your VM without even entering a password and much more securely too!

Without password? How is this possible in the first place?

Well, SSH is based on "public-key cryptography", whose explanation is out of the scope of this manual and probably not the answer you wanted to hear. For simplicity's sake, let's just say that SSH keys come in pairs. There is a private key, that is safely stored to the home machine of the user, and a public key, that is stored to any remote machine the user wants to connect.

So, whenever a user initiates an SSH connection with a remote machine, SSH first checks if the user has a private key that matches any of the public keys in the remote machine and if not, it prompts the user for password.

Now, here's an interesting feature of the Cyclades UI; you have the option to generate a new SSH key pair or upload your own public key on ~okeanos global. This way, you can create VMs that have your own public key already stored in them!

Manage your SSH keys

First, visit the page where you manage your SSH keys.

userguide ssh_keys_tab

In this tab, you can see a list of your public keys. To add a new key to this list, click on the "New Keypair +" button.

userguide ssh_keys_new

From there, you have two options. You can either:

  • Generate a new key pair.
    Choose a name and then click on "Generate new". You will be asked to download the private key to your ssh directory (commonly ~/.ssh/).

    userguide ssh_keys_download

    Your public key, on the other hand, will be stored in ~okeanos global with the name you have chosen.

  • Import a new public key.
    You can either click on "Choose file" to upload your private key or paste the contents of your public key to the key content box. Once you are finished, choose a name and click "Create new".

Note that the new key pair can always be renamed by the pencil icon next to its name, or be removed by the "Destroy" action next to it.

Add a public key to your VM

The easiest way to add a public key to a VM is during its creation phase.

userguide vm_creation_ssh

However, if you have created a VM prior to the above procedure and you want to insert your public key to that one, you can look at this SSH FAQ.

Note: You should always safely store your passwords in case your private key gets deleted or becomes compromised.

Note2: The place where your private key should be stored depends on the OS of your PC. For instance, Linux, Mac Os X and *BSD distros have an ~/.ssh/ folder where your private key should be stored. Windows OSes on the other hand have no such folder and private key management is handled by third-party programs such as Putty, X2Go etc.