Check these if you cannot ssh

In addition to checking that /etc/ssh/sshd_config is correct, you will want to check that the permissions on the user’s home directory and ~/.ssh are correct. I have gathered that:

  • The home directory must only be owned by AND only be writable by the login user.
  • The .ssh directory must only be accessible by the user.
  • The authorized_keys file must be only writable by the user.
[[email protected] ~/.ssh]$ ls -la -D ""
total 14
drwx------  2 foo  foogrp    3  .
drwxr-x---  5 foo  foogrp   15  ..
-rw-r--r--  1 foo  foogrp  395  authorized_keys