Sometimes it could happen, that you’ll change something by accident in your home directory. If this hits .ssh with an established public authorization key system, sshd will prevent you from using the key matching and default to the plain password instead.

$ sudo less /var/log/auth.log

sshd[15124]: Authentication refused: bad ownership or modes for directory /home/user/.ssh

This is rather annoying, but it should not be turned off by just setting StrictMode to off in sshd config, as I consider that a security risk unless you have your user and group privilegues well done on your system. The much easier solution is to provide the correct privilegues on your home directory and .ssh dir.

$ chmod g-w /home/user
$ chmod 700 /home/user/.ssh
$ chmod 600 /home/user/.ssh/authorized_keys
%d bloggers like this: