The basis of this is that your ID must be in the list of authorized hosts in the server. So, for password-less login to work, generate your public key, and append it to the authorized_hosts file in the server.
To create a public key, from terminal do
1 |
ssh-keygen -t rsa |
1 |
cat ~/.ssh/id_rsa.pub | ssh serveruser@server 'cat >> ~/.ssh/authorized_keys' |
1 |
ssh serveruser@server |
If no password is asked, everything worked fine.
You can also do the following command to copy the key
1 |
ssh-copy-id serveruser@server |
5,976 total views, 8 views today