This is an old revision of the document!
How to generate keys to use instead of passwords
Key-based SSH logins rely on the idea of public-key cryptography.
In the process, your client computer generates two keys: a public key and a private key. The idea is that you can encrypt data with the public key, but only decrypt it with the private key. We’ll put the public key on the server and ask it to encrypt all outgoing communication with it. This makes sure that only those clients with the private key can decrypt and read the data.
Install OpenSSH
First, set up an SSH server on the remote computer using OpenSSH. If you already have an SSH server running and just want to know how to set up key-based authentication, you can skip this step. Use your favorite packet manager to install the OpenSSH server application. The simplest way might still be to run the apt-get command from the Terminal.
sudo apt-get install openssh-server
Enter your password, confirm and wait a minute for it to finish installing. Congratulations, you now have an SSH server. (That was easy!)