LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-25-2010, 02:07 AM   #1
saifkhan123
Member
 
Registered: Apr 2009
Distribution: Red Hat/CentOS
Posts: 108

Rep: Reputation: 19
Directory Permissions


the problem is, i have a Linux Centos 5.2 machine, there are 3 directories named Test1, Test2 and Test3. The directory permissions and ownership are as follows
Code:
drwxr-x--- 2 Opr Group1 4096 Jan 22 17:54 Test1
drwxr-x--- 2 Opr Group2 4096 Jan 22 17:54 Test2
drwxr-x--- 2 Opr Group3 4096 Jan 22 17:54 Test3
"Opr" is the user who owns these directories and Opr is the member of group "admins", Only "Opr" is allowed to read-write on all 3 directories.

There are other users in the groups Group1, Group2 and Group3 who have read-only rights on their respective directory, such as Group1 users have read-only access to Test1, Group2 users have read-only access to Test2 and Group3 users have read-only access to Test3, as shown above.

Now, If i want that another user named "Opmgr" can have read-write access on all 3 directories like "Opr" user, but read-only users (i.e. users in Group1,Group2,Group3) scenario must remain same as explained, than what should i do?
 
Old 01-25-2010, 05:59 AM   #2
affinity
Member
 
Registered: Nov 2009
Distribution: Slackware64
Posts: 132

Rep: Reputation: 20
Add the Opmgr to a group that has read-write access on those directories.
 
Old 01-25-2010, 06:12 AM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Look at using facls.
 
Old 01-25-2010, 10:27 PM   #4
saifkhan123
Member
 
Registered: Apr 2009
Distribution: Red Hat/CentOS
Posts: 108

Original Poster
Rep: Reputation: 19
@affinity

Man, i think u havent got the idea, actually i dont want any other user to enter the directory other than its group, if i add Oprmgr to the read-write group and then set that group as the owner of those 3 directories, than no user other than these 2 will be able to access the directories until i set the permissions 775 which is 770 now (which will allow all users to access all the directories read-only, which i dont want).

@Jschiwal
hmmm facls i think would be a gud idea, i will work on tht and will share it here. Thanks
 
Old 01-25-2010, 11:08 PM   #5
affinity
Member
 
Registered: Nov 2009
Distribution: Slackware64
Posts: 132

Rep: Reputation: 20
Quote:
Originally Posted by saifkhan123 View Post
Man, i think u havent got the idea, actually i dont want any other user to enter the directory other than its group, if i add Oprmgr to the read-write group and then set that group as the owner of those 3 directories, than no user other than these 2 will be able to access the directories until i set the permissions 775 which is 770 now (which will allow all users to access all the directories read-only, which i dont want).

@Jschiwal
hmmm facls i think would be a gud idea, i will work on tht and will share it here. Thanks
I think you are the one that "has no idea". I never said to add him to the other users group. If you never plan on adding another user with the same types of permissions as opmgr then you should read the chmod man page.
 
Old 01-26-2010, 05:20 AM   #6
saifkhan123
Member
 
Registered: Apr 2009
Distribution: Red Hat/CentOS
Posts: 108

Original Poster
Rep: Reputation: 19
!!!!!

@affinity, cmon man, read my 1st post carefully, Jschiwal has got my idea and he suggested me the right thing (for which i am thankful to him),


@Jschiwal
Thanks man, i have done it with the facl thingie, i have added the rule in the ACL as

Code:
setfacl -m u:oprmgr:rwx Group1/
so now "oprmgr" has the read-write access on Group1/ dir, woohoo!

Last edited by saifkhan123; 01-26-2010 at 05:24 AM.
 
Old 01-27-2010, 02:58 PM   #7
affinity
Member
 
Registered: Nov 2009
Distribution: Slackware64
Posts: 132

Rep: Reputation: 20
Quote:
Originally Posted by saifkhan123 View Post
@affinity, cmon man, read my 1st post carefully, Jschiwal has got my idea and he suggested me the right thing (for which i am thankful to him),


@Jschiwal
Thanks man, i have done it with the facl thingie, i have added the rule in the ACL as

Code:
setfacl -m u:oprmgr:rwx Group1/
so now "oprmgr" has the read-write access on Group1/ dir, woohoo!
Yea, after seeing this I did not understand what you wanted to do. That is a useful tool, I was not aware that the normal chmod was unable to set permissions for individuals on a file, which I realized after taking my own advice and reading through it's man page.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
File permissions v. directory permissions Completely Clueless Linux - Newbie 7 07-09-2009 08:33 AM
directory permissions goodolday Linux - Newbie 6 04-28-2005 01:51 AM
directory permissions Tinku Linux - General 9 09-25-2004 08:13 PM
directory permissions Tinku Linux - General 2 09-25-2004 11:25 AM
write permissions for directory - not accidently move/deleted the directory linuxgamer Linux - Newbie 10 12-02-2003 03:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration