Generate SSH key pair
For authentication under Unix, authentication via password is often dispensed with and SSH key pair authentication is used instead. With key authentication, the public key of a key pair is stored on the target server.
Generate key pair
You can create a new key pair with the following Bash command. It is recommended to use the -C
option to store an e-mail address so that the intended use of the SSH key can be assigned.
ssh-keygen -t rsa -b 4096 -C name@creoline.com
Key pairs are stored in the corresponding user directory in the .ssh
folder (~/.ssh
).
Store key pair on a Linux server
Make sure that you do not store your private SSH key on a server at any time. The public SSH RSA key always ends with the suffix .pub.
via customer center
Click on Server in the navigation bar and select the desired server on which you would like to store the SSH key. Then select Settings → SSH key file in the top right-hand corner to customize the key file.
You can store the public key in the pop-up window:
The command cat ~/.ssh/id_rsa.pub
outputs the public key from the key pair id_rsa
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 with a command and import it on the server:
ssh-copy-id -i ~/.ssh/id_rsa.pub USER_NAME@SERVER_IP
Authorized Keys
All public and authorized SSH keys that may be used for authentication on the server are stored in a user's authorized_keys
file.
To authorize an additional SSH key, you can add the public key to the file. The storage location is in the following directory:
/root/.ssh/authorized_keys
By removing SSH keys from the authorized_keys
file, the key can no longer be used for authentication in the future.
Attention: Our employees will never ask you for your SSH root password or ask you to store an unknown public SSH key on your server.