If I want to add all of the members who belong to the supplemental group web_users to the apache group (as an additional supplemental group) can I just add web_users group to the apache group? Or do I have to recurse through the members of web_users and do a usermod -G apache $USER
on each one?
Asked
Active
Viewed 1,670 times
5

Gregg Leventhal
- 7,590
2 Answers
3
You have to add each user independently to each group. There is no capability to add groups in a nested fashion in Unix.

slm
- 369,824
1
The unix method closest to what you want is to dynamically generate your groups file from a template using a macro language like m4 and make. The drawback of doing so is that you can not use any other tools to update your groups. the more linux specific method is to write a custom nsswitch module to implement the same behavior. In both cases there would be a disconnect between your administrative groups (groups that may contain groups) and your system groups(posix groups) this can be particularly confusing if they share names.

hildred
- 5,829
- 3
- 31
- 43