Resolve problems with authorized_keys permissions

Sometimes I had problems to connect to a server via public key authentication. In most cases I could solve them by setting up the right permissions for the file and path of the authorized_keys file. This can be done as shown below:

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

Leave a Reply

Your email address will not be published. Required fields are marked *

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.