Find the answer to your Linux question:
Results 1 to 5 of 5

Thread: Group Nesting

Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Exclamation Group Nesting

    Hi All

    I am facing a problem in RHEL6, I want to do multiple grouping for suppose I have 1 Primary Group ADMIN and I wanna add different sub Groups under it. And group nesting goes as below:

    ADMIN GROUP HAVE : IT GROUP (and its users), FINANCE GROUP (and its users) etc etc etc...

    How to do it... what commands I have to give for the same.


  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Not that I am the font of all knowledge Linux, but I am not aware of a way to do what you want, groups as members of a group. There may be tools (of which I am not aware) that will let you copy the members of one group into another, but I think that's about as good as it is going to get. Anyway, this is true for the standard Linux user/group management tools and files ( /etc/passwd, /etc/shadow, /etc/group, ... ). If you are using LDAP or YP, that may not be the case, but I haven't munged with YP for over 15 years, and I am effectively clueless about LDAP/Active-Directory.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    But I just dont want to copy members to another group, I want to place one group within another, its like make a sub group I cannot find a way to do sub grouping

  4. $spacer_open
  5. #4
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Afaik:you cant have nested groups.

    What you can do is to shift the focus from groups to users.
    usermod allows to set a required primary (-g) and arbitrary supplemental groups (-G) for each user.

    usermod will set the groups given and delete the ones not given.
    usermod -g users -G admin,finance talktome322
    Edit: The -a flag might also interest you:
    It will add a user to groups, but not delete.
    Last edited by Irithori; 02-07-2012 at 02:50 AM.
    You must always face the curtain with a bow.

  6. #5
    Linux Newbie theNbomr's Avatar
    Join Date
    May 2007
    BC Canada
    Perhaps you don't understand that users can be members of multiple groups, which is generally enough to establish suitable permissions and privileges for files and directories. Unlike the relationship between files and directories, there is nothing in Linux that describes any relationship between groups. Each group is fully independent of other groups. A user's membership in one group does not imply anything about membership in any other group.

    --- rod.
    Stuff happens. Then stays happened.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts