Monday, February 07, 2005

If SSH with Public/Private Keys isn't working For you, check out this bit of info from my friend Roger.

From Roger Kepler 02-06-05:

I finally got ssh to work! BUT it wasn't easy and there are some extra steps you may not be aware of (or just didn't apply to you). With the ssh client I was getting the message "key refused" even though everything was setup correctly and in the server the public key was also setup correctly.

Well, it's not enough to just have ~.ssh/authorized_keys setup. There's more to it.

I did everything by the book, but it still didn't work. It was very tough and, as always, the devil is in the details. Little did I now I had to edit the /etc/ssh/sshd_config file and enable this line (!):

#PubkeyAuthentication yes
#AuthorizedKeysFile .ssh/authorized_keys -> I just couldn't believe this line is commented out by default!!!

Once I removed the #, it worked...Well, not really. By this time I was about to give up. But, one small detail: the permission on ~.ssh/ needed to be changed:

~ $> chmod 755 .ssh (set dir to 'drwxr-xr-x')
then
~ $>'chmod 644 .ssh/authorized_keys' ('-rw-r--r--')

That did it! SSH now works for me. It only took me about 4+ hours to get it going and it would be even longer without your help.


Thanks for the info Roger.

0 Comments:

Post a Comment

<< Home