Skip to main content
3 of 5
Added details on where to put the autorized_keys file, as well has how to format the line in the sshd_config file to allow for specific users to have different allowable keys

Is your home dir encrypted? If so, for your first ssh session you will have to provide a password. The second ssh session to the same server is working with auth key. If this is the case, you could move your authorized_keys to an unencrypted dir and change the path in ~/.ssh/config.

What I ended up doing was created a /etc/ssh/username folder, owned by username, with the correct permissions, and placed the authroized_keys file in there. Then changed the AuthorizedKeysFile directive in ~/.ssh/config. to :

AuthorizedKeysFile /etc/ssh/%u/authorized_keys

This allows multiple users to have this ssh access without compromising permissions.

cee
  • 679
  • 5
  • 2