Following the process I've used in other environments, I've tried setting-up shared keys between my Mac and my CentOS 4 webserver. I've seen the same problem with my older Ubuntu 7.10 workstation trying to connect via keys to the same webserver.

I have tried both dsa and rsa keytypes (sshkeygen -t <type>).

The sshd_config file on my webserver seems to be allowing key-based logins:

RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile      .ssh/authorized_keys

And my .ssh/authorized_keys has my dsa and rsa keys added.

Where should I be looking for what to change next to make key-based logins "Just Work™"?

Is it related to the line,

#UseDNS yes

and sshd is trying to do a reverse-lookup on my IP, but cannot because it's NAT'd?

link|improve this question

1  
ssh -v to get verbose diagnostics could help pin down the problem. – coneslayer Apr 14 '10 at 17:05
feedback

3 Answers

up vote 4 down vote accepted

~/.ssh/ permissions should be set 0700, and the contents should be 0600.

link|improve this answer
Aha! Similar to permissions requirements for .forward files. Thanks! – warren Apr 14 '10 at 17:26
feedback

This Ubuntu page on SSH Keys is good reading (look at Troubleshooting).

link|improve this answer
feedback

add some -v option when you initiate your ssh connection as

ssh <user>@<host> -vvv 

If ever you have the admin rights to the server, you could also strace -f -p SSHD_PID your sshd

Both of them will give you a bunch of info....

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.