Pcornel
Automation · Linux Automation

User Management

Cheat sheet · https://pcornel.dk/topic.php?topic=5658

Back to the Topic

Answer

Linux User Management automates local account, group, UID/GID, shell, home and membership state while separating identity records, filesystem ownership and effective authorization.

Remember

  • Username exists ≠ expected UID or identity.
  • Group membership written ≠ existing session has refreshed groups.
  • Home directory exists ≠ ownership/permissions correct.
  • Account provisioned ≠ application or sudo authorization correct.

First checks

  • getent passwd <user> — account exists
  • ansible <group> -m user -a 'name=<u> state=present' --check — managed user
  • Central identity (SSSD/LDAP) preference — fewer local users

Verify in this order

user list (source of truth) → automation → hosts

Where it usually breaks

Local account state does not independently prove centralized identity, sudo policy or application authorization.

User Management automation proof-boundary map

BoundaryHealthy evidenceSuspicious evidence
Scope / identityExact source revision, hosts and execution identity are explicitSelector drift, stale inventory or wrong token changes scope/authority
OperationTool/provider action and per-host result are traceablePartial failure, hidden error semantics or environment differences are lost
Platform statePersistent and effective state are read backCommand/cmdlet success is mistaken for convergence
Workload proofOriginal service/application acceptance passesAutomation summary substitutes for actual runtime behavior

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5658

Confirmation

Confirm action

Continue?