Could not chdir to home directory; permission denied
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Could not chdir to home directory; permission denied
Hello:
An user id u01 on a CentOS 6 server fv18:
u01:x:501:501:user 01:/sahome/u01:/bin/bash
From a remote server, ssh to it:
$ ssh -l u01 fv18
u01@fv18's password:*****
Could not chdir to home directory /sahome/u01: Permission denied
On server fv18, the home directory /sahome/u01 is:
drwx------. 4 u01 u01 1024 Sep 2 21:40 u01
sahome’s permission is
drwxr-xr-x. 5 root root 1024 Sep 2 21:53 sahome
sahome itself is a logical volume:
LV Name /dev/vg0/sahome
VG Name vg0
LV Write Access read/write
LV Status available
# open 1
LV Size 100.00 MiB
Current LE 25
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:6
Both servers are CentOS 6. On fv18, # su – u01 works fine.
Have a good holiday.
Warren
Hello:
Update:
ssh actually logs into fv18 as u01. With the chdir error, it puts on "/" instead.
From "/", user u01 can issue command cd to jump to its own home directory...
$ ssh -l u01 fv18
u01@fv18's password:
Last login: Sun Sep 2 22:42:10 2012
Could not chdir to home directory /sahome/u01: Permission denied
[u01@fv18 /]$ pwd
/
[u01@fv18 /]$ cd
[u01@fv18 ~]$ pwd
/sahome/u01
Under u01, manually run
$ . ./.bash_profile
$ . ./.bashrc and
$ . /etc/bashrc all completes without error.
There is no error or warning on /etc/log/messages and /var/log/audit.
Thanks.
Warren
did you get a chance to check SeLINUX, here ls showing "." at the end of file permission, that means SeLinux is there. if all permission looks good than it is selinux which is preventing to change the directory. you must look into selinux
Actually a dot at the end means acls eg getfacl.
You can check SELinux with
Code:
ls -lZ
That would indeed be /var/log/audit, but I asked about /var/log/secure, which is where ssh logs to (or messages if the file does not exist).
Also, as I said, check sshd_config, as this happens (as you have shown) when logging in via ssh.
I set SELinux on fv18 to permissive, then ssh to fv18 as u01 works fine without the chdir error.
It appears the file system /sahome has access restrictions. If i change u01's home directory to /home, ssh does not have any issue regardless of SELinux's setting.
Where /home is a sub-directory; /sahome is a file system.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.