I keep forgetting this line…
$ cat ~/.ssh/id_dsa.pub | ssh user@host 'cat >> .ssh/authorized_keys'
Update – you might instead want to try:
$ cat ~/.ssh/id_rsa.pub | ssh user@host 'cat >> .ssh/authorized_keys'
If it still doesn’t work, check the file permissions:
0700 on the
.ssh directory and
0644 on the
authorized_keys file are working for me,
Thanks to Mathias Kettner – SSH login without password.
Update (2021-01-17): Easier, and just works (which the former method doesn’t anymore on my latest server):
$ ssh-copy-id user@host
Update: See Gert van Dijk – Upgrade your SSH keys!
Update (2017-06-19): For a while, it seemed one should use
.ssh/authorized_keys2 instead. Someday I’ll take the time to actually learn about this…