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_rsaand~/.ssh/id_rsa.pub. Copy theid_rsa.pubon the Desktop as~/.ssh/authorized_keys.