Have you ever had problem with ssh passwordless login using different users? Below are step by steps guide that solved that problem.
Senario :
User johndoe on machine pluto is accessing user foo on server mercury, without entering any password..
The Guide:
1. on pluto, johndoe need to generate his own private/public key pairs (i'am using dsa)
pluto# ssh-keygen -t dsa
- when asked for a password, leave it blank, just press "Enter" twice.
the key pairs will be saved in $HOME/.ssh/ (id_dsa and id_dsa_pub)
2. copy over id_dsa_pub to foo at mercury, then add the content of id_dsa_pub to foo's $HOME/.ssh/authorized_keys
mercury# cat id_dsa_pub >>authorized_keys
3. make sure foo's $HOME/.ssh directory permission is set to 700.
mercury# chmod 700 $HOME/.ssh
4. Now the important part: make sure to enable these settings on mercury's /etc/ssh/sshd_config
ForwardAgent yes
PubkeyAuthentication yes
StrictModes no
most people forgot to sets these settings that make them unable to ssh with different user, without a password.
5. restart sshd deamon.
mercury# /etc/inti.d/sshd restart
6. ok you're done, try ssh from pluto
pluto# ssh foo@mercury
By now you already should logon to foo on mercury without the need to key-in foo's password...
ok good luck....
.::Polaris::.