Interview Prep/Linux/SSH & Access Hardening

What is DynamicUser= in systemd?

AdvancedProductionSSH & Access Hardening
Answer

DynamicUser=yes allocates a transient UID/GID when the service starts and releases it when it stops, so no permanent account exists to be abused. It implies ProtectSystem=strict, ProtectHome=read-only, PrivateTmp=yes and NoNewPrivileges=yes. Persistent data goes in StateDirectory=api (/var/lib/api), LogsDirectory=, CacheDirectory=, which systemd chowns automatically. Great for stateless helpers and exporters.

All Linux questions Roadmap: Linux

More on SSH & Access Hardening