Quote:
Originally Posted by ongte
Very odd looking problem you have there. Could it be a SELinux context issue?
Try looking at the output of these:
# ls --context /home
# ls --context /home/jon
If not SELinux, it could also be an ACL issue. Try:
# getfacl /home
|
I had the same problem. On one of my hosts I kept receiving this error:
Could not chdir to home directory /home/me: Permission denied
upon login. After logging in, I could just chdir manually into it.
This error in turn also prevented SSH from using key authentication, as the .ssh directory was unreachable before logging in, and SSH defaulted to requesting the password.
After painstakingly checking all the many usual things with SSH on both sides, I checked the SElinux contexts:
on the well-behaving hosts:
# ls --context -d /home /home/me
drwxr-xr-x. root root system_u

bject_r:home_root_t:s0 /home
drwx------. me me unconfined_u

bject_r:user_home_dir_t:s0 /home/me
on the misbehaved host:
# ls --context -d /home /home/me
drwxr-xr-x. root root system_u

bject_r:file_t:s0 /home
drwx------. me me unconfined_u

bject_r:user_home_dir_t:s0 /home/me
Notice the /home/me has the same context, while /home hasn't, having file_t instead of home_root_t.
Simply running
# restorecon /home
solved a problem which had taken a few hours to figure out.