File permissions for successful SSH login via authorized_keys
Caveat Lector: This blog post was published 11 years ago. Depending on the content, it may no longer be applicable or relevant.
If you want to ssh into your server without being repeatedly prompted for the password you can copy your public ssh key into a file called authorized_keys in the .ssh subdirectory of the user’s home directory. However, this works only if the permissions for this file are set correctly. Otherwise, it will keep asking for the user’s password.
- The permissions of the
homedirectory of the remote user must be755 - The permissions of the remote
.sshdirectory must be700 - The permissions of the remote
authorized_keysfile must be600
Of course all of those must be owned by the remote user, and not by root.
If you found a mistake in this blog post, or would like to suggest an improvement to this blog post,
please get in touch at michael@franzl.name; as subject
please use the prefix "Comment to blog post" and append the post title.