Hands-on Lab·Linux Foundation Certified System Administrator
Groups and shared directories
Group membership is examined constantly, and the mistake that costs marks is one missing letter: usermod -G replaces the supplementary group list while -aG adds to it. This guide shows the difference on a live account, then builds the shared directory that group membership exists for.
Users and Groups Guide 19 of 38 Intermediate
- PlatformsUbuntu 26.04 LTS + AlmaLinux 10.2
- LVM2.03.31 (Ubuntu) / 2.03.36 (AlmaLinux)
- nftables1.1.6 (Ubuntu) / 1.1.5 (AlmaLinux)
- TimeAbout 16 min
shadow-utils, identical on both families. The admin group is wheel on RHEL and sudo on Debian and Ubuntu - the same idea with a different name.
- Firewallufw 0.36.2 enabled but reporting inactive / firewalld active
- Network confignetplan + systemd-networkd / NetworkManager 1.56.0
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| LFCS-A01 | 192.168.0.70 | Ubuntu 26.04 LTS | Primary host - most guides run only here | 2 Core | 4 GB | 50 GB |
| LFCS-C01 | 192.168.0.72 | AlmaLinux 10.2 | The other distribution - dnf, firewalld and NetworkManager | 2 Core | 4 GB | 50 GB |
This guide includes
Use this because group membership is examined constantly. This matters because usermod -G replaces the supplementary groups rather than adding to them - quietly removing access somebody already had.
- separating primary from supplementary groups
- meeting the flag that replaces instead of adding
- changing the primary group, and seeing what happens to the old one
- building the shared directory groups exist for, with setgid
- running the same group flags on Ubuntu, where they behave identically
Before you start
-
Primary and supplementary
-
The flag that replaces instead of adding
-
Changing the primary group
-
The shared directory groups exist for
-
The same commands on Ubuntu