Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

change directory 2

Status
Not open for further replies.

xeryus

Technical User
May 25, 2001
11
US
Hello Gurus -
I have a directory (/home/NYC) with several home directories, all the users are in the same group:
/home/NYC/queens
/home/NYC/bronx
/home/NYC/yonkers

How can I prevent the user 'bronx' from changing directory to /home/NYC or any other, except their own home directory?

Thanks in advance!
 
You can set the privileges to each user directory to 700 which will deny access to everyone except the owner.
 
Thanks, that would solve part of the problem. However I would also like 'bronx' to not see anything or change directory in /home/NYC. I tried changing the permission on /home/NYC to 700, that denied all the users access to their home directories.
 
Your user home directories are /home/NYC/<username>. You want to deny access between users. To do this, change the privileges on each users home directory to 700. Don't change the privileges to /home/NYC, change the privileges to /home/NYC/<username>.

 
Try this..
Code:
chmod 710 /home/NYC
chmod 700 /home/NYC/bronx
chmod 700 /home/NYC/queens
chmod 700 /home/NYC/yonkers
That's having only the execute bit set at the group level for [tt]/home/NYC[/tt]. This is all that's required for them to see their own home dir. This will even keep them from listing what's in the /[tt]/home/NYC[/tt] directory, but they will still have access to their own dir.

The 700 on the home dirs means they can only see their own home dir and not anyone elses.

Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top