Scenario: Connect from Laptop to Desktop using SSH without password prompt.
-
Login to Laptop terminal.
-
Make sure there is a .ssh directory in home folder of user and that it is only accessible to the user:
mkdir ~/.ssh
chmod 700 ~/.ssh
- Generate SSH keys (using RSA algorithm in this case):
ssh-keygen -t rsa
- This will generate the files
~/.ssh/id_rsa
and~/.ssh/id_rsa.pub
. Copy theid_rsa.pub
on the Desktop as~/.ssh/authorized_keys
.