WHAT ARE SSH KEYS AND HOW CAN I USE THEM?
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-knossos. 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.
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.
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/).
Your public key, on the other hand, will be stored in ~okeanos 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.
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.
CYCLADES USER GUIDE
- How to create a VM?
- How do I connect to a VM?
- How do I manage my VM?
- How can I resize the CPU/RAM of an existing VM?
- How can I attach/detach an IP on a running VM?
- How can I add extra disks to my VMs?
- How can I detach an extra disk from a VM?
- How can I add tags to my VMs?
- How can I assign my VM to a project?
- What are SSH keys and how can I use them?
- What are private networks?
- What is a firewall and which one should I choose?
- How can I access all my VMs using one public IP (NAT)?
- How can I add IPv6 nameservers on my CentOS/Oracle Linux VM?