Group Membership Management
One objective, and one mistake worth more marks than the rest of the domain combined: usermod -G without -a replaces every secondary group instead of adding one, reports nothing, and exits 0. It is captured happening. The guide also builds the shared directory that group tasks usually want.
Users and Groups Guide 19 of 67 Intermediate
- OSRHEL 10.0
- Kernel6.12.0-55.9.1.el10_0
- dnf4.20.0
- Flatpak1.16.0
- TimeAbout 15 min
Red Hat uses the user private group scheme: useradd bob also creates a group bob and makes it his primary. That is why a home directory can be bob:bob and why umask 002 is safe here - the group is a group of one.
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| RHCSA-A01 | 192.168.0.31 | RHEL 10.0 | Practice node (graded) - spare /dev/sda | 2 Core | 4 GB | 50 GB + 15 GB |
This guide includes
Use this for the one mistake worth more marks than the rest of the domain. This matters because a single missing letter in usermod replaces every secondary group instead of adding one to them.
- separating primary membership from secondary
- creating and renaming groups
- adding a user to groups, and meeting the missing letter that removes the rest
- seeing the primary group decide file ownership
- building a shared directory with SGID, then removing membership cleanly
Before you start
- A sudo-capable account.
- The session creates and removes a user, two groups and
/srv/shared.
-
Primary and secondary
-
Creating and renaming groups
-
Adding a user to groups
-
The missing letter
-
The primary group decides file ownership
-
A shared directory with SGID
-
Removing membership and groups