LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices

Reply
 
Search this Thread
Old 09-14-2012, 06:41 AM   #1
crazy_linux
LQ Newbie
 
Registered: Sep 2012
Posts: 1

Rep: Reputation: Disabled
Smile can we set muliple SGID only for single directory ?


Hello All,

Thanks for viewing my posts. I am beginner to Linux World. Thanks for those people who are trying to answer my questions.

My question is that suppose say that as an root I have created a directory called opensource under /

so now this /opensource directory has 755 permissions (Default)

Now suppose say I have two groups created as Sales and Finance.

2 users say tom and harry are the part of secondary group Sales

2 users say ram and laxman are the part of secondary group Finance

Now my question is I would like to have SGID set on this /opensource directory in such a way that whenever the user tom or harry creates files in /opensource directory the group owner of the file should reflect with Sales.

Whenever ram and laxman creates the files in /opensource directory the group owner of the files should reflect with Finance.


Is this possible to set with the commands or do we need any scripts ?
 
Old 09-14-2012, 06:49 AM   #2
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,436
Blog Entries: 11

Rep: Reputation: 181Reputation: 181
I guess you would need a script. But there might be the chance that you can go with ACL. setfacl and getfacl are the binaries for it.
You sure would need the sgid settings. The sgid access right makes every file owned by the group of the parent folder. But i don't know if this is valid within ACL. Just try and see.
 
Old 09-29-2012, 01:37 PM   #3
nijinashok00
LQ Newbie
 
Registered: Sep 2012
Posts: 28

Rep: Reputation: Disabled
We cannot make two group owners for a directory. Sgid makes group owner of all newly created files and directories within the parent directory as the parent directory group owner. Since we cannot make two group owners for a directory we can't make Sgid with two group.
 
Old 09-30-2012, 11:58 AM   #4
techguru666
LQ Newbie
 
Registered: Jul 2012
Posts: 24

Rep: Reputation: Disabled
With normal permissions, and even with SGID bit, it is not possible. You can set permissions on two different groups through file ACLs, using command 'setfacl'. But with SGID, what you are trying to accomplish is not possible.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
how to set up single sign on with apache with Active directory Braytac Linux - Software 1 11-08-2007 05:54 PM
suid on directory - doesn't, sgid ok? pingu Linux - Security 1 01-18-2006 04:04 PM
setting muliple IP addresses on Single NIC cranium2004 Linux - Networking 1 02-08-2005 05:55 AM
Help! Setting SGID on directory skilian Linux - General 1 09-06-2004 04:57 AM
sgid/directory security connman Linux - Security 2 04-15-2004 11:42 AM


All times are GMT -5. The time now is 06:16 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration