The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
changing multiple directory names w/ sed RahJiggah OS X (Apple) 1 11-05-2007 09:55 AM
Changing Directory Using SFU ilak1008 Windows & DOS: Issues & Discussions 1 05-21-2007 11:50 PM
/root directory - date keeps changing??? Alux Linux 1 03-16-2006 02:28 AM
Changing directory through script mrgubbala UNIX for Dummies Questions & Answers 5 02-11-2005 06:12 AM
changing directory on server bb00y High Level Programming 1 12-05-2003 08:59 PM

Closed Thread
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-03-2002
Registered User
 

Join Date: Jun 2002
Posts: 9
Stumble this Post!
Changing directory on Unix

Hi,
Can you please help ? I work on SCO Unix Open server Rel. 5.
User root on Unix can change/view/modify any files belonging to any user on a file system.
Is there any way where I can prevent non-root users to change thier directories to other non-root users area.

for eg. There are 2 users User A and User B.
User A's home directory is /A
User B's home directory is /B

My objective is user A should not be allowed to change his pwd (present working directory) to /B and user A should also not be allowed to list the files which are stored in /B directory ( home of user B).

Setting necessary read-write-execute permissions does not prevent either users to change directories in each others area and they are still able to list what files are stored in each others directories.

Is there any way ?
Thanks for your time and regards.
Taher
Forum Sponsor
  #2 (permalink)  
Old 06-04-2002
Registered User
 

Join Date: Mar 2002
Location: Hamburg
Posts: 10
Stumble this Post!
Wink Re: Changing directory on Unix

Try this (as root, of course):

# chown A ~A
# chown B ~B
# chmod 700 ~A ~B

Now nobody else can change into home directory of them. They can do theirself and root only.

Changing to a directory requires execution right (-x-), reading the contents of a directory requires read right (-r-).

So it depends on what exactly you want to allow them. For example if you want to allow A to change to ~B (~ means home directory of ...) but not to allow to read:

# groupadd oaandb (only A and B)
# usermod -G oaandb A
# usermod -G oaandb B
# chgrp oaandb ~B
# chmod g+x ~B

You can use access control lists (ACL) to eliminate creation of this kind of groups everytime


Quote:
Originally posted by taher_n
Hi,
Can you please help ? I work on SCO Unix Open server Rel. 5.
User root on Unix can change/view/modify any files belonging to any user on a file system.
Is there any way where I can prevent non-root users to change thier directories to other non-root users area.

for eg. There are 2 users User A and User B.
User A's home directory is /A
User B's home directory is /B

My objective is user A should not be allowed to change his pwd (present working directory) to /B and user A should also not be allowed to list the files which are stored in /B directory ( home of user B).

Setting necessary read-write-execute permissions does not prevent either users to change directories in each others area and they are still able to list what files are stored in each others directories.

Is there any way ?
Thanks for your time and regards.
Taher
  #3 (permalink)  
Old 06-04-2002
linuxpenguin's Avatar
Registered User
 

Join Date: May 2002
Location: India
Posts: 295
Stumble this Post!
Re: Changing directory on Unix

Hi,

As far as i my knowledge goes if a directory does not have a execute permission you cannot do d cd to that directory

e.g dir A has permissions 744
and anyone other than the owner tries to do 'cd A' will get a error saying permission denied

as per iat00's reply i think you need not set the permissions to 700 , coz the cd command checks only for the execute permission as far as a directory file is concerned


i hope i m very clear

rgds
penguin
__________________
War doesnt determine who is right, it determines who is left
  #4 (permalink)  
Old 06-04-2002
Registered User
 

Join Date: Jun 2002
Posts: 9
Stumble this Post!
Thanks

Thanks "iat00" and "linuxpenguin" yes ! what u both have suggested works out for me !!
actually i had misunderstood before that the bit "x" only controls excution rights and not cd (change directories).
thanx once again for ur time
regs
Taher
Google The UNIX and Linux Forums
Closed Thread

Thread Tools
Display Modes




All times are GMT -7. The time now is 11:12 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0