Operating System - HP-UX
1834594 Members
3914 Online
110069 Solutions
New Discussion

Multiple groupowners for a single directory.

 
sudhapage
Regular Advisor

Multiple groupowners for a single directory.

Hi All,

Is it possible to give multiple groupowners for a single directory? Please suggest.

Regards,
Sudhakaran.K
5 REPLIES 5
Srimalik
Valued Contributor

Re: Multiple groupowners for a single directory.

Not sure abt the answer but What made you think of this kind solution?
What is the reason don't you want single group ownership, You can add the user to whom you want to give access to this group.

Sri
abandon all hope, ye who enter here..
sudhapage
Regular Advisor

Re: Multiple groupowners for a single directory.

Hi

Actually we have three groups with differnet users.

And we need to assign 3 groups as a owner of one single directory.

Also later we want to add more groupowner for this directory.

Regards,
Sudhakaran.K
Srimalik
Valued Contributor

Re: Multiple groupowners for a single directory.

Ok..Which filesystem are you using

ACLs can help you..
abandon all hope, ye who enter here..
Srimalik
Valued Contributor

Re: Multiple groupowners for a single directory.

see "man setfacl" and "man getfacl"
This two commands will do the job for you
abandon all hope, ye who enter here..
Court Campbell
Honored Contributor

Re: Multiple groupowners for a single directory.

As Srikrishan stated, you want to use setacl. Here is a quick example:

setacl -m default:group:groupname:rw- some_dir

The above example will give a group rw access to a directory and the default keyword would give any files and folders created within the directory those default perms. One thing to note is that if you already have files under the folder that you are going to give the other groups access, you will need to change the perms on the files in the folder. Changing the perms with setacl does not propogate to the files and folders within the directory you made the permission changes to. In that case you can do something like this:

setacl -m group:groupname:rw- somefile

or

setacl -m group:groupname:rw- *

You could use the find command with -exec to make changes to all the files and folders underneath the directory.

Hope that helps.
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"