Strangest behavior I've seen in a while:I have:Setup a Linux user account with a password, and an ssh key.When this user owns their home directory, they can login with the ssh key.When this user does not own their home directory, sshd complains:Authentication refused: bad ownership or modes for directory /path/to/home/user/When I remove the Linux account password: This user may login with their ssh key while not owning their home directory.Wat? Why does sshd stop caring about them owning their home directory?
Why doesn't sshd care that a user doesn't own their home directory when their login has no password?
sshd
This is little bit more complicated than you are describing (and you omit many important details to completely answer this question). But the source code is a good place to start:The failure is issued only if the public key authentication is performedThe parent directories are important and they are accepted only ifthe sshd can stat() itthe directory is owned by the logging in user OR root on Linux (platform_sys_dir_uid() takes care of that)the directory is not writable by any other user (the write bit can be set only for the owner)This basically matches your first two points, but not the third one. There will be something else in round you changed or did not notice. Turn on the debug logging on the server and investigate it (or post it to the edited question).