Automation · Linux Automation
User Management
Cheat sheet · https://pcornel.dk/topic.php?topic=5658
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 existsansible <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
| Boundary | Healthy evidence | Suspicious evidence |
|---|---|---|
| Scope / identity | Exact source revision, hosts and execution identity are explicit | Selector drift, stale inventory or wrong token changes scope/authority |
| Operation | Tool/provider action and per-host result are traceable | Partial failure, hidden error semantics or environment differences are lost |
| Platform state | Persistent and effective state are read back | Command/cmdlet success is mistaken for convergence |
| Workload proof | Original service/application acceptance passes | Automation 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