Interview Prep/Linux/User Lifecycle, Auditing & Time Sync

How should service accounts be created and governed?

IntermediateProductionUser Lifecycle, Auditing & Time Sync
Answer

One account per service, system UID range, no login shell, no password, home under /var/lib/<svc> or none, owning only its own files, and least-privilege sudo (ideally none). Prefer systemd DynamicUser= where possible. Track owner and purpose in config management, and review periodically for unused accounts.

sudo useradd -r -s /usr/sbin/nologin -d /var/lib/orders -M orders
All Linux questions Roadmap: Linux

More on User Lifecycle, Auditing & Time Sync