Pcornel
Browse topics
Options
Recent
Favorites
Linux · Technical reference

Users

Direct answer

A Linux user account has a name, UID, primary group, home directory and login shell (in /etc/passwd) and a password hash (in /etc/shadow). System accounts run services; regular accounts are for people.

When to use this

Use it when creating or troubleshooting accounts, or when someone cannot log in.

First 30 seconds

1. getent passwd <user> — exists? Shell and home?

2. passwd -S <user> / chage -l <user> — locked or expired?

3. Home exists and owned by the user? ls -ld /home/<user>.

4. SSH login failing → journalctl -u ssh -u sshd | tail.

5. Fix and test the login.

Operational verification

account in passwd/directory → password or key valid and not expired → shell allowed → home available → session starts

Evidence · next step

For Users & Groups → Users, continue with the first unproven Topic check: Resolve the account name and numeric UID from the same host/context as the workload. If that boundary is healthy, advance to the adjacent check: Inspect primary/supplementary groups and the actual process credentials. 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 when creating or troubleshooting accounts, or when someone cannot log in.
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

account source → resolved username/UID → primary GID + supplementary groups → login/service launch → effective process UID → target authorization → workload result

Healthy evidence: the intended account resolves to the expected stable UID, process credentials match that identity and the intended workload runs with the required access.

Step 2 Verification and output interpretation Verify boundary

Existing fast checks for this Topic. - Resolve the account name and numeric UID from the same host/context as the workload.

  • Inspect primary/supplementary groups and the actual process credentials.
  • Check home/shell only as configured attributes, then verify the referenced resources separately.
  • Test the intended operation as the effective user rather than only inspecting the account record.

Verification chain. account source → resolved username/UID → primary GID + supplementary groups → login/service launch → effective process UID → target authorization → workload result

Step 3 Commands Verify boundary
useradd -m -s /bin/bash alice
passwd alice
usermod -L alice
Step 4 Failure modes and next checks Narrow the fault

Suspicious evidence: duplicate or unexpected UIDs, stale group membership in an existing session, or metadata fields being interpreted as evidence that login and target access work.

Step 5 Common mistakes Narrow the fault
  • Deleting users and leaving their files/cron jobs.
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

Create with useradd -m -s /bin/bash <user> (or adduser on Debian), set the password with passwd, lock with usermod -L or passwd -l. A shell of /usr/sbin/nologin blocks interactive login. Directory users (LDAP/AD via SSSD) appear in getent but not in /etc/passwd.

Key checks
  • chage -l <user> — password ageing and expiry
  • 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

Distinguish account record, authentication capability, session creation and process identity. Verify which identity source resolves the account, whether the UID is stable and unique in the relevant namespace, what groups are initialized, and which effective UID the workload actually runs as. Account metadata is descriptive input, not evidence of a live session or authorization outcome.

ReferenceImportant terms & boundaries5 sections · depth on demand

What this shows and what it does not

A valid user record shows resolvable account metadata, not successful authentication, session initialization, target authorization or application behavior.

In depth

User accounts: what defines a user

A Linux user is a name mapped to a numeric UID, with a primary group, a home directory and a login shell. Local users are stored in /etc/passwd. The passwd(5) manual page defines the seven colon-separated fields: name, password, UID, GID, GECOS (comment), home directory and shell.

If the shell is empty, /bin/sh is used. A shell that doesn't exist prevents login through login(1).

Kinds of accounts

KindUID range (typical)ShellExample
root0/bin/bashroot
System / service accounts1–999/usr/sbin/nologin or /bin/falsewww-data, sshd, postgres
Regular users1000 and up/bin/bash, /bin/zshalice
nobody65534nologinUsed for unprivileged processes and NFS squashing

Where users can come from

Local files are only one source. /etc/nsswitch.conf decides the order of sources, such as files, SSSD, LDAP or systemd's dynamic users. Use getent passwd <name> instead of grepping /etc/passwd. getent shows the user whatever the source, exactly as the system resolves it.

Useful commands

QuestionCommand
Who am I, and in which groups?id, id alice
Is the user known to the system?getent passwd alice
Who is logged in now?who, w
Last loginslast -n 5, lastlog -u alice
Which processes run as a user?ps -u alice -o pid,cmd
host$ getent passwd alice
alice:x:1003:1003:Alice Example:/home/alice:/bin/bash
host$ grep '^passwd' /etc/nsswitch.conf
passwd:         files systemd sss
host$ getent passwd jdoe
jdoe:*:1186801105:1186800513:John Doe:/home/jdoe@corp.example.net:/bin/bash
host$ awk -F: '$7 !~ /(nologin|false)$/ {print $1, $3, $7}' /etc/passwd
host$ id -nG alice
alice adm ssh-users

Reading the example

jdoe isn't in /etc/passwd at all. getent finds him through SSSD (sss in nsswitch.conf), with a UID mapped from Active Directory. That's why grep alone misses domain users, and why local and directory UIDs must not overlap.

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

Users is part of Users & Groups → Users. Users are Linux account identities represented by numeric UIDs plus account metadata such as name, primary GID, home directory and login shell; interactive humans, service accounts and system accounts can share the same underlying credential model while serving different operational purposes.

Topic-specific state model. Users are Linux account identities represented by numeric UIDs plus account metadata such as name, primary GID, home directory and login shell; interactive humans, service accounts and system accounts can share the same underlying credential model while serving different operational purposes.

Interpretation rule. - Account record ≠ active login/session.

  • Service/system account ≠ automatically non-interactive or harmless.
  • Home directory or shell field ≠ evidence the path/program exists or is usable.
  • User name uniqueness ≠ UID uniqueness across all identity namespaces or mounted data.

Quick reference

User management:

useradd -m -s /bin/bash -c 'Alice Jensen' -G wheel alice      # sudo group: wheel (RHEL) / sudo (Debian)
passwd alice
usermod -aG docker alice          # -a is essential, otherwise groups are replaced
chage -l alice; chage -M 90 -W 14 alice
usermod -L alice; usermod -e 1 alice     # lock / expire
userdel -r bob                     # remove with home
id alice; getent passwd alice
lastlog; last -n 20

System accounts for services: useradd -r -s /usr/sbin/nologin -d /var/lib/app app. In larger environments use central identity (SSSD with AD/FreeIPA/LDAP) instead of local accounts.

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 valid user record shows resolvable account metadata, not successful authentication, session initialization, target authorization or application behavior.

ReferenceConfiguration & state1 section · depth on demand

Configuration, persistence and lifecycle

Distribution/platform context. Users owns Linux account identity. Authentication, PAM/SSH, home-directory filesystem state, shell behavior and object permissions stay with the relevant Topics.

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 → Users. 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 user accountslinux usersuser identity linuxservice account linux
Embedded reference data

Quick lookup tables

Users operational reference

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

Lookup boundaryTopic-specific referenceOperational use
Scope / effective stateUsers are Linux account identities represented by numeric UIDs plus account metadata such as name, primary GID, home directory and login shell; interactive humans, service accounts and system accounts can share the same underlying credential model while serving different operational purposes.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 chainaccount source → resolved username/UID → primary GID + supplementary groups → login/service launch → effective process UID → target authorization → workload resultTrace requested/configured state through effective state to the observed workload result.
Failure boundaryA valid user record proves resolvable account metadata, not successful authentication, session initialization, target authorization or application behavior.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: account source → resolved username/UID → primary GID + supplementary groups → login/service launch → effective process UID → target authorization → 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. A valid user record proves resolvable account metadata, not successful authentication, session initialization, target authorization or application behavior.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.

Users · operational reference

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

Reference boundaryUsers
Topic pathUsers & Groups → Users
Runtime stateUsers are Linux account identities represented by numeric UIDs plus account metadata such as name, primary GID, home directory and login shell; interactive humans, service accounts and system accounts can share the same underlying credential model while serving different operational purposes.
Fast checks- Resolve the account name and numeric UID from the same host/context as the workload. - Inspect primary/supplementary groups and the actual process credentials. - Check home/shell only as configured attributes, then verify the referenced resources separately. - Test the intended operation as the effective user rather than only inspecting the account record.
Verification chainaccount source → resolved username/UID → primary GID + supplementary groups → login/service launch → effective process UID → target authorization → 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 boundaryA valid user record proves resolvable account metadata, not successful authentication, session initialization, target authorization or application behavior. 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?