Pcornel
Browse topics
Options
Recent
Favorites
Linux · Technical reference

Groups

Direct answer

Groups collect users so permissions can be granted once. Each user has one primary group (new files' group) and any number of supplementary groups.

When to use this

Use it to give several users shared access, or when a user's group-based access does not work.

First 30 seconds

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.

Operational verification

group created → user added → new login loads the group → files with that group and group permissions are accessible

Evidence · next step

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
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 give several users shared access, or when a user's group-based access does not work.
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

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 -G without -a removing other groups.
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

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.

Key checks
  • 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

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 groupSupplementary groups
Defined inThe GID field of /etc/passwdThe member list in /etc/group
Effect on new filesNew files get this group (unless the directory is setgid)No effect on new files
Used for access checksYesYes
Change for one shellnewgrp <group>—

Groups that grant privileges (examples)

GroupTypical meaning
sudo (Debian, Ubuntu) / wheel (RHEL)May use sudo per the default sudoers rules
admRead many log files
dockerFull control of the Docker daemon, effectively root
systemd-journalRead the full journal
libvirtManage 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.

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

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).

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. 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
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 → Groups. 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
linux groupssupplementary groups linuxgid membershipgroup permissions linux
Embedded reference data

Quick lookup tables

Groups operational reference

Topic-specific lookup boundaries, proof limits and next-step Evidence for Groups.

Lookup boundaryTopic-specific referenceOperational use
Scope / effective stateGroups 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 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 chaingroup source → name/GID resolution → user membership → session supplementary-group initialization → process GID set → inode group/ACL comparison → access decision → workload resultTrace requested/configured state through effective state to the observed workload result.
Failure boundaryGroup 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 evidenceCorrelated 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 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. 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 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.

Groups · operational reference

Compact Linux state, persistence, verification and boundary reference for fast lookup.

Reference boundaryGroups
Topic pathUsers & Groups → Groups
Runtime stateGroups 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 chaingroup 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 boundaryGroup 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 ruleProve which configuration source owns the state, then prove that the running consumer loaded or generated the intended state.
Confirmation

Confirm action

Continue?