Use it to see or change group membership.
/etc/group
/etc/group lists local groups: name:x:GID:members. Supplementary members are listed there; a user's primary group comes from /etc/passwd.
1. getent group <group> — GID and members?
2. User missing → gpasswd -a <user> <group>.
3. Primary group → check the GID in getent passwd <user>.
4. grpck -r — consistency.
5. New login to apply.
group defined with a GID → members listed → loaded at login → used in permission checks
For Users & Groups → /etc/group, continue with the first unproven Topic check: Validate group name/GID and explicit member syntax. If that boundary is healthy, advance to the adjacent check: Resolve group and user membership through the effective identity stack. 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
/etc/group record + passwd primary GID → NSS resolution → effective membership → session group initialization → process GID set → target DAC/ACL → result
Healthy evidence: local and effective identity resolution agree, the session carries intended groups and the target policy consumes them as expected.
Step 2 Verification and output interpretation Verify boundary
Existing fast checks for this Topic. - Validate group name/GID and explicit member syntax.
- Resolve group and user membership through the effective identity stack.
- Inspect primary plus supplementary GIDs on the real process/session.
- Compare numeric GIDs with target policy and repeat the original operation after any required re-login.
Verification chain. /etc/group record + passwd primary GID → NSS resolution → effective membership → session group initialization → process GID set → target DAC/ACL → result
Step 3 Commands Verify boundary
getent group wheel
gpasswd -a alice wheel
Step 4 Failure modes and next checks Narrow the fault
Suspicious evidence: primary group is overlooked, an old session lacks new membership, or external NSS data conflicts with the local record.
Step 5 Common mistakes Narrow the fault
- Editing without
vigr.
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.
Edit with groupadd, gpasswd -a/-d or usermod -aG, or vigr — not a plain editor. A user's primary group is not listed in the members field.
grpck -r— check group file consistencyid <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
Interpret the record alongside /etc/passwd and the active NSS stack. Resolve the group numerically, then inspect the supplementary-group list in the actual session because editing /etc/group does not rewrite credentials of already running processes. Do not infer effective file access until target ownership/mode/ACL is evaluated.
ReferenceImportant terms & boundaries5 sections · depth on demand
What this shows and what it does not
A group-file entry shows local configured membership only, but it does not show effective membership in an existing process or access to a target object.
In depth
/etc/group and gshadow
/etc/group defines local groups and their members. The group(5) manual page specifies the format: one line per group, with group_name:password:GID:user_list. The member list holds comma-separated user names, and an empty password field means no password is needed. The secure counterpart, /etc/gshadow, holds group passwords and group administrators in the same way that /etc/shadow does for users.
Fields
| Field | Example | Notes |
|---|---|---|
| group_name | ssh-users | |
| password | x | Real data in /etc/gshadow; group passwords are rarely used |
| GID | 1010 | |
| user_list | alice,bob | Supplementary members only |
Primary members aren't listed
A user whose primary GID is a group is a member of it, even though their name doesn't appear in the member list. getent group alice normally shows an empty member list for alice's private group. To list all members, combine both sources.
Managing groups
| Task | Command |
|---|---|
| Create with a fixed GID | groupadd -g 1020 reports |
| Add a member | gpasswd -a alice reports or usermod -aG reports alice |
| Remove a member | gpasswd -d alice reports |
| Rename | groupmod -n analytics reports |
| Delete | groupdel reports |
| Edit by hand, safely | vigr (and vigr -s for gshadow) |
| Consistency check | grpck -r |
host$ getent group reports
reports:x:1020:alice
host$ awk -F: -v g=1020 '$4 == g {print $1}' /etc/passwd
carol
host$ sudo gpasswd -a bob reports
host$ getent group reports
reports:x:1020:alice,bob
host$ sudo grpck -r
host$ getent group sudo wheel 2>/dev/null
sudo:x:27:admin,alice
Reading the example
carol isn't in the member list, but she's still in the group, because her primary GID is 1020. Scripts that check membership by reading only /etc/group miss users like her. id -nG <user> shows the complete list per user.
Documented example, not captured output.
How it works at runtime
/etc/group is part of Users & Groups → /etc/group. /etc/group is the traditional local group database containing group name, numeric GID and explicit member list; the user primary group is usually derived from the passwd record and may not appear in the group member field.
Topic-specific state model. /etc/group is the traditional local group database containing group name, numeric GID and explicit member list; the user primary group is usually derived from the passwd record and may not appear in the group member field.
Interpretation rule. - Explicit member list ≠ full effective membership including primary GID.
- File edit ≠ existing process group refresh.
- Local group record ≠ only identity source when NSS uses external directories.
- Membership ≠ permission without matching target policy.
Quick reference
/etc/group format: group:x:GID:member1,member2. Users whose primary group this is are not listed — they are identified by GID in /etc/passwd. /etc/gshadow holds group passwords and administrators.
getent group wheel sudo docker
vigr # safe edit
grpck -r
Be careful with powerful groups: wheel/sudo (admin), docker (root-equivalent via the socket), libvirt, disk (raw disk access), adm (read logs), shadow.
Limits and how it fails
Primary failure point. A group-file entry shows local configured membership only, but it does not show effective membership in an existing process or access to a target object.
Membership listed in /etc/group does not show an existing process has that supplementary group. sudo authorization is not the same as shell root login, and root can still be constrained by namespaces, read-only mounts, immutable attributes or LSM rules.
ReferenceConfiguration & state1 section · depth on demand
Configuration, persistence and lifecycle
Configuration intent and lifecycle. Treat /etc/passwd, /etc/shadow, /etc/group and sudoers as policy databases with strict syntax, ownership and permission requirements, while remembering that NSS can source identities elsewhere.
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 → /etc/group. 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
/etc/group operational reference
Topic-specific lookup boundaries, proof limits and next-step Evidence for /etc/group.
| Lookup boundary | Topic-specific reference | Operational use |
|---|---|---|
| Scope / effective state | /etc/group is the traditional local group database containing group name, numeric GID and explicit member list; the user primary group is usually derived from the passwd record and may not appear in the group member field. | 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 | /etc/group record + passwd primary GID → NSS resolution → effective membership → session group initialization → process GID set → target DAC/ACL → result | Trace requested/configured state through effective state to the observed workload result. |
| Failure boundary | A group-file entry proves local configured membership only; it does not prove effective membership in an existing process or access to a target object. | 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: /etc/group record + passwd primary GID → NSS resolution → effective membership → session group initialization → process GID set → target DAC/ACL → 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. A group-file entry proves local configured membership only; it does not prove effective membership in an existing process or access to a target object. | 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. |
/etc/group · operational reference
Compact Linux state, persistence, verification and boundary reference for fast lookup.
| Reference boundary | /etc/group |
|---|---|
| Topic path | Users & Groups → /etc/group |
| Runtime state | /etc/group is the traditional local group database containing group name, numeric GID and explicit member list; the user primary group is usually derived from the passwd record and may not appear in the group member field. |
| Fast checks | - Validate group name/GID and explicit member syntax. - Resolve group and user membership through the effective identity stack. - Inspect primary plus supplementary GIDs on the real process/session. - Compare numeric GIDs with target policy and repeat the original operation after any required re-login. |
| Verification chain | /etc/group record + passwd primary GID → NSS resolution → effective membership → session group initialization → process GID set → target DAC/ACL → 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 | A group-file entry proves local configured membership only; it does not prove effective membership in an existing process or access to a target object. 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. |