Skip to content

Howto Add Public SSH Key

You can generate an SSH key in different ways. The current webpage describes how to do this via the terminal or via puttygen.

To generate an SSH key via the terminal, you can use the following command:

ssh-keygen

This key will automatically be stored in the following directory:

/users/[username]/.ssh/

Two files will be stored here, namely your public and private key. These will be the following files:

id_rsa id_rsa.pub

The .pub file is your public key and can be read out with the following command:

cat id_rsa.pub

You will now see your public key, which you can then add to a server to gain access to it.

To generate an SSH key via Putty, you can use the tool puttygen. If you already use Putty, it is installed by default. Otherwise, you can download this tool separately. When you have downloaded this tool, you can generate a new key by clicking the generate button.

You can then create a passphrase to secure the private key. We always recommend using a passphrase to store your private key as securely as possible. When a passphrase is set, you can save the key.

These keys will be stored in the folder /Users/username/.ssh/ with the names id_rsa and id_rsa.pub.

To check if the key has been successfully added, you can search for the name of the key in the authorized_keys file if you already have access via SSH on the server.

You can find more information about generating and using SSH keys on Theory7.net.