Install a ssh clientsudo apt-get install ssh
Login to the ssh server with your client.
Generate your key pair using the following command: (Don't use any passphrase)
sahab@xxxx:~$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/sahab/.ssh/id_rsa):
Created directory '/home/sahab/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/sahab/.ssh/id_rsa.
Your public key has been saved in /home/sahab/.ssh/id_rsa.pub.
The key fingerprint is:
The key's randomart image is:
+--[ RSA 2048]----+
|.o . |
|+.o. . S |
|= .o . |
| .+.o.. |
sahab@xxx:~$ cd ~/.ssh
sahab@xxx:~/.ssh$ cat id_rsa.pub >> authorized_keys
sahab@xxx~/.ssh$ chmod 600 authorized_keys
Log out of the server and go back to your local shell
$ cd .ssh
Copy the file id_rsa that was generated on the server into this directory. You can use sftp or scp for this.
$ cd .ssh
$ chmod 600 id_rsa
You should now be able to login via ssh without having to prompt for a password.