can we set muliple SGID only for single directory ?
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 ?
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.
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.
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.
|All times are GMT -5. The time now is 02:28 PM.|