Good info at
http://www.deadman.org/ssh-tut.html --only thing it is missing is a troubleshooting tip: try ssh -v remote.host to see problems.
Hint: check the fileperms on your dirs. Home should be 700 or 755, ~/.ssh should be 700, ~/.ssh/* should be 600.
The classic sshd PITA scenario solved:
$ sudo /usr/sbin/sshd
Could not load host key: /etc/ssh/ssh_host_key
Could not load host key: /etc/ssh/ssh_host_rsa_key
Could not load host key: /etc/ssh/ssh_host_dsa_key
Disabling protocol version 1. Could not load host key
Disabling protocol version 2. Could not load host key
sshd: no hostkeys available -- exiting.
Solutions:
- The easy way: start sshd like this instead: $ sudo /etc/init.d/sshd restart
- (um, well, may have to do other prep work, like mkdir /etc/ssh ...
- ... or hacking your sshd rc script to generate the host keys in another dir ... ymmv)
- The hard way:
- sudo ssh-keygen -t rsa1 -f /etc/ssh/ssh_host_key -N
- sudo ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N
- sudo ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N