27
Feb

Proper authorized_keys Permissions for Passwordless SSH Access

I recently used the guide over at http://linuxproblem.org to setup passwordless SSH access between hosts (direct link), but for some reason, I was still being prompted to enter a password. I spent a while studying the verbose messages from ssh -vv without any resolution. I returned to the guide and saw a small note about permissions on the bottom of the page. I ran through the instruction there as well, but with no resolve. I finally came across the OpenSSH FAQ page which thankfully explained one or more permission settings I was missing. If you find yourself in my same shoes, try running the following commands on the remote host you’re trying to connect to:

chmod 700 $HOME/.ssh
chmod go-w $HOME $HOME/.ssh
chmod 600 $HOME/.ssh/authorized_keys
chown `whoami` $HOME/.ssh/authorized_keys

This is what got things to work for me after fighting with it for a while. I hope it helps somebody else out there too. Also, if there’s any room for improvement, let me know. I wasn’t looking for an optimized solution at the time because I was tired of fighting.

Feel free to donate if this post prevented any headaches! Another way to show your appreciation is to take a gander at these relative ads that you may be interested in:


There's 0 Comment So Far

Share your thoughts, leave a comment!