Service account ownership
Relate a web file owner to the identity used by its service.
Understand the pattern
Matching service identities with file ownership helps operators explain what they know before they change anything.
stat- Inspect a file or directory metadata record, including ownership, permissions, and size.
Metadata and file contents answer different questions.
id- Inspect user identity and group membership.
A file group is useful only when the acting user belongs to it or has an applicable override.
systemctl- Inspect or change a simulated systemd service. Status, active state, and unit configuration reveal different evidence.
A service can be active while an application endpoint is unhealthy; verify both layers.
Worked example and expected result
$ stat /srv/www/index.htmlPath: /srv/www/index.html Type: file Mode: -rw-r--r-- Owner: www-data Group: www-data Size: 72 bytes
Exit status: 0. The command completed successfully in the training fixture.
$ id www-datauid=33(www-data) gid=33(www-data) groups=33(www-data)
Exit status: 0. The command completed successfully in the training fixture.
$ systemctl status nginxnginx.service - simulated nginx Loaded: loaded Active: active Notes: serving the simulated static learn site
Exit status: 0. The command completed successfully in the training fixture.
Explain it
Apply it elsewhere
Keep the momentum.
Complete the lab, then explain and apply the pattern.
Next: Least privilege bridgeTry an incident drillAnonymous lesson and mastery progress lasts for this session. Sign in to keep synced lesson XP between sessions; mastery stays device-local. No speed bonus, lost lives, or hint penalties.