Use it to give several users shared access, or when a user's group-based access does not work.
Groups
Groups collect users so permissions can be granted once. Each user has one primary group (new files' group) and any number of supplementary groups.
1. id <user> — group listed?
2. Added but not effective → log out and in, or restart the service.
3. Add: usermod -aG <group> <user> (with -a).
4. getent group <group> — members.
5. Test access as the user.
group created → user added → new login loads the group → files with that group and group permissions are accessible
For Users & Groups → Groups, continue with the first unproven Topic check: Resolve the target group and numeric GID. If that boundary is healthy, advance to the adjacent check: Capture primary and supplementary GIDs from the actual session/process. Preserve the same host/time/identity scope and rerun the original workload before accepting recovery.
Continue only after interpreting the current observation.Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Operational evidence path Verify boundary
group source → name/GID resolution → user membership → session supplementary-group initialization → process GID set → inode group/ACL comparison → access decision → workload result
Healthy evidence: the process carries the intended GID set and the target policy grants the required access to that set.
Step 2 Verification and output interpretation Verify boundary
Existing fast checks for this Topic. - Resolve the target group and numeric GID.
- Capture primary and supplementary GIDs from the actual session/process.
- Compare those GIDs with target ownership, mode and ACL mask/effective entries.
- Restart/re-authenticate only when needed to test refreshed membership, then repeat the original operation.
Verification chain. group source → name/GID resolution → user membership → session supplementary-group initialization → process GID set → inode group/ACL comparison → access decision → workload result
Step 3 Commands Verify boundary
groupadd ops
usermod -aG ops alice
id alice
Step 4 Failure modes and next checks Narrow the fault
Suspicious evidence: membership was added but the existing process lacks the GID, the wrong same-named group resolves, or group membership is treated as an authorization grant by itself.
Step 5 Common mistakes Narrow the fault
usermod -Gwithout-aremoving other groups.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
Add with usermod -aG <group> <user> — without -a the user is removed from other groups. New group membership applies only to new logins (newgrp or log out and in). Service users may need a restart.
id <user>— UID, primary group and groupsgetent passwd <user>— account entry (local or directory)getent group <group>— group memberssudo -l -U <user>— what the user may run with sudo
ReferenceWhat it is1 section · depth on demand
Core model
Resolve group names to numeric GIDs, then inspect the group list attached to the actual process. Membership stored in /etc/group or an external directory is not automatically retroactive to existing sessions. For permission troubleshooting, compare the process GID set with the target inode group and ACL entries rather than relying on textual membership alone.
ReferenceImportant terms & boundaries5 sections · depth on demand
What this shows and what it does not
Group membership evidence shows identity association in a source or process, not that the target grants rights or that an old session has refreshed membership.
In depth
Groups: primary and supplementary membership
Groups give several users the same access to files, devices and privileges. Every user has one primary group (the GID field in /etc/passwd) and any number of supplementary groups. The group(5) manual page defines the four fields of /etc/group:
- the group name;
- an optional group password;
- the numeric GID;
- a comma-separated list of member user names.
The credentials(7) manual page adds that since Linux 2.6.4, a process can belong to up to 65,536 supplementary groups.
Primary and supplementary groups
| Primary group | Supplementary groups | |
|---|---|---|
| Defined in | The GID field of /etc/passwd | The member list in /etc/group |
| Effect on new files | New files get this group (unless the directory is setgid) | No effect on new files |
| Used for access checks | Yes | Yes |
| Change for one shell | newgrp <group> | — |
Groups that grant privileges (examples)
| Group | Typical meaning |
|---|---|
sudo (Debian, Ubuntu) / wheel (RHEL) | May use sudo per the default sudoers rules |
adm | Read many log files |
docker | Full control of the Docker daemon, effectively root |
systemd-journal | Read the full journal |
libvirt | Manage virtual machines |
Membership changes take effect at the next login
A process gets its group list when the session starts. After usermod -aG, the user must log in again, or start a new shell with newgrp or su - <user>, before the new group applies.
host$ getent group ssh-users
ssh-users:x:1010:alice,bob
host$ sudo groupadd -g 1020 reports
host$ sudo gpasswd -a alice reports
Adding user alice to group reports
host$ id -nG alice
alice adm ssh-users reports
host$ id -nG
admin sudo
host$ sudo gpasswd -d bob ssh-users
host$ getent group | awk -F: '$4 ~ /alice/ {print $1}'
Reading the example
id -nG alice asks the user database and already shows "reports". But id -nG for the current shell shows only its existing groups. The difference between the two is exactly the "it works after I log out and in again" effect.
Documented example, not captured output.
How it works at runtime
Groups is part of Users & Groups → Groups. Groups aggregate Linux identities under numeric GIDs so discretionary access and application policy can be delegated to sets of users; a process can carry one primary GID and multiple supplementary GIDs initialized from the identity stack.
Topic-specific state model. Groups aggregate Linux identities under numeric GIDs so discretionary access and application policy can be delegated to sets of users; a process can carry one primary GID and multiple supplementary GIDs initialized from the identity stack.
Interpretation rule. - Group database membership ≠ supplementary groups already loaded into a running process.
- Primary GID ≠ only group relevant to access.
- Group name ≠ GID; names can differ while numeric identity drives DAC.
- Membership ≠ write/execute permission unless target policy grants it.
Quick reference
Groups give shared access; each user has one primary group (new files' group) and supplementary groups.
groupadd devops
gpasswd -a alice devops; gpasswd -d alice devops
getent group devops
newgrp devops # start shell with new group active
id -Gn alice
Group membership changes apply at next login (or newgrp/su - alice); running processes and SSH sessions keep old groups. Shared project directories: group ownership + SGID bit + umask 002 (or default ACLs).
Limits and how it fails
Primary failure point. Group membership evidence shows identity association in a source or process, not that the target grants rights or that an old session has refreshed membership.
ReferenceConfiguration & state1 section · depth on demand
Configuration, persistence and lifecycle
Distribution/platform context. Groups owns group identity and membership semantics. Permissions & Ownership owns how group credentials are consumed by DAC/ACL evaluation.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Users & Groups → Groups. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.kernel.org/doc/man-pages/ · confidence 94%What changed and what may be affected
Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.
Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Quick lookup tables
Groups operational reference
Topic-specific lookup boundaries, proof limits and next-step Evidence for Groups.
| Lookup boundary | Topic-specific reference | Operational use |
|---|---|---|
| Scope / effective state | Groups aggregate Linux identities under numeric GIDs so discretionary access and application policy can be delegated to sets of users; a process can carry one primary GID and multiple supplementary GIDs initialized from the identity stack. | Establish exactly what this Topic owns before crossing into another subsystem. |
| Fast verification | Pin the exact process/session → resolve user/group names to numeric UID/GID through the effective identity stack → capture effective UID/GID + supplementary groups → resolve every required path component and target inode → inspect numeric owner/group + mode + ACL/mask + special bits → capture sudo/privilege transition if present → account for non-DAC controls → repeat the original workload operation. | Use the shortest evidence path first; a fast check is a boundary test, not blanket proof. |
| Verification chain | group source → name/GID resolution → user membership → session supplementary-group initialization → process GID set → inode group/ACL comparison → access decision → workload result | Trace requested/configured state through effective state to the observed workload result. |
| Failure boundary | Group membership evidence proves identity association in a source or process, not that the target grants rights or that an old session has refreshed membership. | Stop broad troubleshooting at the first boundary that is not supported by evidence. |
| Positive evidence | Correlated Linux identity and authorization evidence can establish this proof path: group source → name/GID resolution → user membership → session supplementary-group initialization → process GID set → inode group/ACL comparison → access decision → workload result | Use this observation only for the specific claim it actually supports. |
| Evidence limit | It does not independently prove behavior outside the captured identity source, process credential, filesystem object, DAC/ACL, privilege or workload scope. Group membership evidence proves identity association in a source or process, not that the target grants rights or that an old session has refreshed membership. | Do not promote a local success signal into end-to-end or adjacent-dependency proof. |
| Next troubleshooting check | Continue from the first unproven boundary: keep the same process/session, resolve numeric identity and groups, inspect each path component plus target ownership/mode/ACL/special bits, capture any privilege transition/non-DAC denial, then repeat the original operation before broadening permissions. | Continue to the next unresolved boundary while preserving the original test condition. |
Groups · operational reference
Compact Linux state, persistence, verification and boundary reference for fast lookup.
| Reference boundary | Groups |
|---|---|
| Topic path | Users & Groups → Groups |
| Runtime state | Groups aggregate Linux identities under numeric GIDs so discretionary access and application policy can be delegated to sets of users; a process can carry one primary GID and multiple supplementary GIDs initialized from the identity stack. |
| Fast checks | - Resolve the target group and numeric GID. - Capture primary and supplementary GIDs from the actual session/process. - Compare those GIDs with target ownership, mode and ACL mask/effective entries. - Restart/re-authenticate only when needed to test refreshed membership, then repeat the original operation. |
| Verification chain | group source → name/GID resolution → user membership → session supplementary-group initialization → process GID set → inode group/ACL comparison → access decision → workload result Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return/regression → explicit Evidence boundary. Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return path or regression → explicit Evidence boundary. |
| Failure boundary | Group membership evidence proves identity association in a source or process, not that the target grants rights or that an old session has refreshed membership. Boundary chain: process/context → userspace configuration → kernel subsystem/resource → device/network/filesystem dependency → effective state → original workload. |
| Persistence rule | Prove which configuration source owns the state, then prove that the running consumer loaded or generated the intended state. |