It's all or nothing: if you turn the StrictModes
option off, sshd will never check any file modes. There's no way to say that certain odd cases are ok, such as a group-writable directory (which is ok if the user is alone in the group).
OpenSSH checks the permissions and ownership of ~/.ssh/authorized_keys
and its containing directories recursing upwards. However, it stops the comparison when it reaches the home directory. For example, in the classical arrangement where the authorization file is /home/joe/.ssh/authorized_keys
and /home/joe
is the user's home directory, only /home/joe/.ssh/authorized_keys
, /home/joe/.ssh
and /home/joe
are checked.
So while your scenario is highly dubious (/pkg
should be owned by root, with additional group permissions if required), it should not impact ssh.
If any symbolic links are involved, note that ssh expands all symlinks before starting its checks.
The system logs might have relevant information. Check if your failed login attempts cause any log message.
Check that your version of ssh performs the same checks as mine (I looked at the source of OpenSSH 5.5p1) by running a debug mode daemon on a custom port (sshd -d -p 2222
). Use strace -f -efile sshd -d -p 2222
if necessary to check which files' permission the server checks. If these permission checks aren't the issue, adding more -d
flags might throw some light.
If you have AppArmor, there's also the possibility that it is restricting the ssh server to reading files in users' .ssh
directories. If you have AppArmor and home directories in a nonstandard location, you'll need to update AppArmor policies (not just for SSH). See Evince fails to start because it cannot read .Xauthority.
ls -ld /pkg /pkg/home /pkg/home/usera /pkg/home/usera/.ssh /pkg/home/usera/authorized_keys
for a problem user? – miracle173 Sep 13 '12 at 20:39