Pcornel
Browse topics
Options
Recent
Favorites
Linux · Technical reference

/etc/group

Direct answer

/etc/group lists local groups: name:x:GID:members. Supplementary members are listed there; a user's primary group comes from /etc/passwd.

When to use this

Use it to see or change group membership.

First 30 seconds

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.

Operational verification

group defined with a GID → members listed → loaded at login → used in permission checks

Evidence · next step

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
Platform / version applicability
linux
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

Platformlinux
Scope / prerequisiteUse it to see or change group membership.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

5 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

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 references

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.

observation · 1
Key points

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.

Key checks
  • grpck -r — check group file consistency
  • id <user> — UID, primary group and groups
  • getent passwd <user> — account entry (local or directory)
  • getent group <group> — group members
  • sudo -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

FieldExampleNotes
group_namessh-users
passwordxReal data in /etc/gshadow; group passwords are rarely used
GID1010
user_listalice,bobSupplementary 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

TaskCommand
Create with a fixed GIDgroupadd -g 1020 reports
Add a membergpasswd -a alice reports or usermod -aG reports alice
Remove a membergpasswd -d alice reports
Renamegroupmod -n analytics reports
Deletegroupdel reports
Edit by hand, safelyvigr (and vigr -s for gshadow)
Consistency checkgrpck -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.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

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.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

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
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor doclinux current

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%
Technical changelog & impact

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.

Related reference impactReview these references after material technical changes when their shared boundary is affected.
Terminology layer

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.

Aliases that resolve here
etc grouplinux group filegroup database linuxsupplementary group file
Embedded reference data

Quick lookup tables

/etc/group operational reference

Topic-specific lookup boundaries, proof limits and next-step Evidence for /etc/group.

Lookup boundaryTopic-specific referenceOperational 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 verificationPin 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 → resultTrace requested/configured state through effective state to the observed workload result.
Failure boundaryA 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 evidenceCorrelated 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 → resultUse this observation only for the specific claim it actually supports.
Evidence limitIt 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 checkContinue 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 pathUsers & 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 boundaryA 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 ruleProve which configuration source owns the state, then prove that the running consumer loaded or generated the intended state.
Confirmation

Confirm action

Continue?