Skip to content
Clairos Learn

Permissions and users · Lesson 32 of 33 · 8 minutes

Service account ownership

Relate a web file owner to the identity used by its service.

Mastery 0/3Run itExplain itApply it
learner@clairosSimulated Linux lab
learner@clairos:~ $
↑ history · Tab complete · Ctrl+C cancel · Esc, Tab to leaveExit 0

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.html
Path: /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-data
uid=33(www-data) gid=33(www-data) groups=33(www-data)

Exit status: 0. The command completed successfully in the training fixture.

$ systemctl status nginx
nginx.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.

Try a variation

Repeat this workflow in the sandbox with a different scratch filename. Keep the system fixtures unchanged and compare the observed output with your expectation before moving on.

Explain it

In “Service account ownership”, which interpretation is safe?

Apply it elsewhere

Before adapting the id workflow from “Service account ownership” to another server, what should you do?

Keep the momentum.

Complete the lab, then explain and apply the pattern.

Next: Least privilege bridgeTry an incident drill

Anonymous 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.

Keep learning

  1. 01SSH mode matrixCompare directory and key-file modes used by an SSH account.Practice
  2. 02Least privilege bridgeCheckpoint ownership, group assignment, and minimum useful modes.Practice