Ubuntu – SSH keys not working

ssh

I'm using ssh-keygen to generate a key on Ubuntu 10.10, then using ssh-copy-id to copy the key to two remote machines that are running 10.04 (one desktop, the other server).

But here's the thing: I can SSH into the desktop without a password, but then some time later I'm asked for a password again. The server always asks for a password and never lets me login with my key.

I've checked permissions on the .ssh folder, the authorized_keys file, my id_dsa and my id_dsa.pub on all hosts, and they're inline with what the Ubuntu documentation suggests. I've even copied my keys using scp and gasp set permissions to files and folders to 777 just to rule out any permission issues.

Does anyone have a foolproof way of setting up SSH keys on Ubuntu for password-less SSH access before I change profession and become a flower arranger?

Best Answer

First of all, I suggest, if you can, to remove+purge, then reinstall openssh-client/server on the three machines, and remove each ~/.ssh, so that you start from a clean situation.

Next, follow this ubuntu wiki page that treats more specifically of ssh keys configuration.

Last, keep in mind the following issue: from debian ssh wiki:

Login without password does not work if group or world has write permissions for the home directory on the remote machine.

Related Question