Creating an SSH-key-pair

From TurnKey+MediaWiki
Jump to navigation Jump to search

In this post we will show you how to create a ssh-key and how to upload it correctly to your server.

Creating SSH-key

- To generate an SSH-key, enter the following command on the "home" terminal:

ssh-keygen -t rsa -b 4096


1. -t stands for type and this determines the type of key 2. -b stands for bits. This can be used to determine the length of the key.

Saving the SSH-key

Enter file in which to save the key (/home/me/.ssh/id_rsa):

Here you can select a different location and an alternative name for the file containing the private key. Just press "Enter" to accept the given suggestion.


Enter passphrase (empty for no passphrase):

Optionally, a password for the public key can be assigned here. This is always queried when the public key file is used to establish a connection.

Enter same passphrase again:

Enter the same password again. If the field is empty, simply press "Enter"

Copying the SSH-key on your server

ssh-copy-id youruser@ip-address

Copy the public key to the desired server. For this the password of the server is necessary. NOTE: this will only work if the public key lays on the default location

Login without password-authentication

Now, if all of the steps are done right you´ll be able to login over ssh without your password. Simply connect over ssh (if you choose a password in the key, use the keys password

ssh youruser@ip-address