SSH-keys

SSH-keys are a pair of encrypted keys (private and public) that are used for authorization when you connect to the server via the SSH protocol. We recommend using SSH keys instead of a password to increase the reliability and security of the connection.

To connect to the server using SSH keys:

  • Create a pair of SSH keys - after creation, the private key is stored on the computer where the connection is made, and the public key is placed on the server.

  • Place the public key on the server with the Control panel. You can store public SSH keys in the CloudSSH keys section.

Creating SSH-key in Linux

To create an SSH-key:

  1. Go to the Control panel to the CloudSSH Keys section.

  2. In the upper right corner click on the Create button, then the interface for adding an SSH-key will open.

  3. Specify the name of the key.

  4. Open a terminal and run the following command:

ssh-keygen
  1. It will be possible to save the key and name it:

Generating the public/private rsa key pair. Enter file in which to save the key (/Users/USER/.ssh/id_rsa):
  1. Next, it will be possible to create and confirm a passphrase for the key:

Enter passphrase (empty for no passphrase):
  1. Re-enter to confirm:

Enter the same passphrase again:

8. After executing the commands there should be created two generated files id_rsa and id_rsa.pub. id_rsa.pub is the open (public) key. Its content should add to the Panel:

cat ~/.ssh/id_rsa.pub
  1. Copy the public key and paste it into the interface for adding an SSH-key to the site.

  2. Click Create SSH-Key.

Creating SSH-key in Windows

To create a pair of SSH-keys in Windows 10 via the command line (cmd.exe) like in Linux/macOS.

Earlier versions of Windows use PuTTY for generation keys:

  1. Install PuTTY and run the PuTTYgen app.

  2. In the contents Type of key to generate select the RSA key type.

  3. Click Generate. After creation, the public key will be displayed on the screen.

  4. Copy the public part of the generated key from the window Public key into Open SSH authorized_keys file and paste into interface the addings of SSH-key on the website and click Create SSH-Key.

  5. In the PuTTYgen app click the Save private key button.

  6. Specify a file name and click Save.

Connecting to the server using SSH-key in Windows

  1. Launch the PuTTY program. Select Connection - Data. In the Auto-login username field enter the root login.

  2. Select Connection - SSH - Auth. In the bottom field Private key file for authentication field, click Browse… and select the file that was saved earlier with the extension .ppk during the creation an SSH-key.

  3. Go to Session and in the field Host name (or IP address) enter the IP address of the virtual server you need to connect to.

  4. Click Open to connect to the server.

Removing an SSH-key

To delete the SSH-key you created earlier:

  1. Go to the Control panel to the CloudSSH Keys.

  2. Click the Delete button.