Generate an SSH Key Pair

For authentication on Unix systems, password-based authentication is often avoided in favor of SSH key pair authentication. With key-based authentication, the public key of a key pair is stored on the target server.


Generating a key pair

You can create a new key pair using the following Bash command. It is recommended to use the -C option to specify an email address so that the SSH key can be assigned a specific purpose.


ssh-keygen -t rsa -b 4096 -C name@creoline.com

Key pairs are stored in the .ssh folder within the corresponding user directory (~/.ssh).



Storing a Key Pair on a Linux Server


Make sure you never store your private SSH key on a server. The public SSH RSA key always ends with the suffix .pub.

Via the Customer Center

Click Server in the navigation bar and select the server where you want to store the SSH key. Then, in the top-right corner, select Settings → SSH Key File to configure the key file.

In the pop-up window, you can store the public key:


The command cat ~/.ssh/id_rsa.pub outputs the public key from the id_rsa key pair as text.


via SSH command

To store the public key on a server, you can use the OpenSSH command ssh-copy-id to read the key and import it onto the server with a single command:

ssh-copy-id -i ~/.ssh/id_rsa.pub USER_NAME@SERVER_IP


Authorized Keys

A user’s authorized_keys file stores all public and authorized SSH keys that may be used for authentication on the server.

To authorize an additional SSH key, you can add the public key to the file. The file is located in the following directory:

/root/.ssh/authorized_keys


Removing SSH keys from the authorized_keys file will prevent that key from being used for authentication in the future.


Warning: Our staff will never ask you for your SSH root password or ask you to add an unknown public SSH key to your server.