HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
Showing results for 
Search instead for 
Did you mean: 

canot chdir to a directory

Go to solution
Valued Contributor

canot chdir to a directory

Dear Gurus,

I tried to crete one chroot jail environemnt for one of the user,user1 ,however the user was instead being logged in to / and not the chroot /, as the case should be.i used this script /opt/ssh/utils/ssh_chroot_setup.sh.

my os version is 11.31.This could have happened as the chroot user,user1, being created might not have had access to the directory, which belongs to user2.

So , i added another user whose primary group is same as the user2 with restricted shell

useradd -g winstall -s /usr/bin/rsh -d /tango/INB_UAT1/chrlie/Batch/AllBatch/data/reports/jrxml raritan

now raritan is also logged in to the system as / , and not at his home directory , which should be /tango/INB_UAT1/chrlie/Batch/AllBatch/data/reports/jrxml.The error that shows while login is "Could not chdir to home directory /inbdata/INB_UAT1/EBUATP4/Batch/AllBatch/data/ reports/jrxml: Permission denied"

but :

apple1:#ls -ld /tango/INB_UAT1/charlie/Batch/AllBatch/data/reports/jrxml/

drwxrwxrwx 11 user3 winstall 10240 Mar 27 16:33


Please suggest ,


Honored Contributor

Re: canot chdir to a directory

There's probably at least one directory on the path from / to the chrooted users' home directories that is not accessible to those users.

Please run:
ll /tango
ll /tango/INB_UAT1
ll /tango/INB_UAT1/charlie
ll /tango/INB_UAT1/charlie/Batch
ll /tango/INB_UAT1/charlie/Batch/AllBatch
.. etc. all the way to the users' home directories.

The access (x) permissions are the important ones: if the user does not have access permission for all the parent directories of his home directory, the home directory is not accessible.

Valued Contributor

Re: canot chdir to a directory

Dear Matti ,

You solution is right on the spot , as they are most of the times.
Soluiton was a chmod -R ug+x ./directory