Creating keys with OpenSSH
Creating an SSH key pair using OpenSSH is an essential step for establishing a secure connection to your ccloud³ VMs at centron. Here’s how to do it:
Generating an SSH key pair with OpenSSH
-
Run SSH-Keygen:
Open your terminal. Enter the command
ssh-keygento generate a 2048-bit RSA key pair. This is sufficient for most applications. -
Select a save location:
You will be prompted to choose a location for the keys. By default, they are stored in the
~/.sshdirectory, whereid_rsais the private key andid_rsa.pubis the public key. Using the default locations allows your SSH client to find your SSH keys automatically. It is recommended that you accept this by pressing ENTER.Generating public/private rsa key pair.
Enter file in which to save the key (/home/username/.ssh/id_rsa): -
Take care with existing keys:
If you have already generated a key pair, you may be prompted with a message stating that
/home/username/.ssh/id_rsaalready exists. If you choose to overwrite the key on the hard drive, you will no longer be able to use the previous key. Overwriting is an irreversible process. -
Enter an optional password:
You will be prompted to enter an optional password, which will encrypt the private key file on the hard drive. If you enter a password, you will need to enter it every time you use this key. It is recommended that you use a password; however, you can skip this prompt by pressing ENTER.
Created directory '/home/username/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again: -
Completion of the creation process
Once the process is complete, you will have a public and a private key pair that you can use for authentication.
Your identification has been saved in /home/username/.ssh/id_rsa.
Your public key has been saved in /home/username/.ssh/id_rsa.pub.
The key fingerprint is:
a9:49:EX:AM:PL:E3:3e:a9:de:4e:77:11:58:b6:90:26 username@203.0.113.0
The key's randomart image is:
+--[ RSA 2048]----+
| ..o |
| E o= . |
| o. o |
| .. |
| ..S |
| o o. |
| =o.+. |
|. =++.. |
|o=++. |
+-----------------+
Next steps
Add a public key to your centron account:
Add your public key to your centron account so that it can be embedded in new ccloud³ VMs when they are created.
Adding a public key to existing ccloud³ VMs:
Add your public key to existing ccloud³ VMs to use SSH key authentication for logging in.