LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Create a Group under an existing Group (https://www.linuxquestions.org/questions/linux-newbie-8/create-a-group-under-an-existing-group-641382/)

asadrony 05-11-2008 12:18 AM

Create a Group under an existing Group
 
Hi, I want to create a fresh group under an existing group, is it possible. How to.............Thanks.

dudeman41465 05-11-2008 12:40 AM

As in you want to create a group that inherits rights from another group above it, but also has its own set of specified rules? Sorry to answer a question with a question but I'm just kind of clarifying so I know what I'm looking for.

fbianconi 05-11-2008 12:43 AM

I don't understand the question, perhaps you're trying to make another group that has same user that are already on other group?
If that so, there isn't any group inheritance (that I'm aware of) so what I would do is to make a new group and add members to it, since a user can have many groups besides it's initial group

as root:
Code:

groupadd newgroup
usermod -a -G newgroup someuser
usermod -a -G newgroup someotheruser

changing users an groups names as needed

jschiwal 05-11-2008 01:53 AM

If the suid bit is set on a directory in Linux, if you create a file in that directory, the owning group of the file will be inherited fron the owning group of the directory. The default group of the writer will be lost however. You might want to look at the setfacl and getfacl programs. You can add permissions for several groups or owners.

setfacl -m user:jim:r filename
setfacl -m user:jane:rw filename
setfacl -m group:netgroup:rw filename
setfacl -m group:labgroup:r filename

You can shorten user to u, group to g and string -m entries:
setfacl -m u:jim:r -m u:jane:rw -m g:netgroup:rw -m g:labgroup:r filename

asadrony 05-11-2008 10:50 PM

Thanks...therefore, I want to say, there is already existing a group "Mkt" (Marketing), now I want to add a new group "sales" into "mkt" group. Is possible...........thanks

jschiwal 05-12-2008 08:06 PM

Groups don't have group members. There are no subgroups.


All times are GMT -5. The time now is 10:27 PM.