cancel
Showing results for 
Search instead for 
Did you mean: 

canot chdir to a directory

SOLVED
Go to solution
DeafFrog
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

/tango/INB_UAT1/charlie/Batch/AllBatch/data/reports/jrxml/

Please suggest ,

Regards,


FrogIsDeaf
2 REPLIES
Matti_Kurkela
Honored Contributor
Solution

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.

MK
MK
DeafFrog
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

Regards,
Rahul
FrogIsDeaf