Skip to content
Clairos Learn

Permissions and users · Lesson 6 of 33 · 8 minutes

Owner review

Change simulated owner and group labels on a web file.

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

Owner and group mistakes can break deployments.

chown
Change ownership; on a real Linux system changing the file owner normally requires elevated privilege.

Ownership and mode bits are separate controls; inspect both.

chgrp
Change the file group within the permissions of the acting user.

A group name alone does not grant access unless membership and mode bits agree.

stat
Inspect a file or directory metadata record, including ownership, permissions, and size.

Metadata and file contents answer different questions.

Worked example and expected result
$ sudo chown admin:www-data /srv/www/index.html
(no output; exit 0)

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

$ chgrp www-data /srv/www/index.html
group www-data set on /srv/www/index.html

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

$ stat /srv/www/index.html
Path: /srv/www/index.html
Type: file
Mode: -rw-r--r--
Owner: admin
Group: www-data
Size: 72 bytes

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 “Owner review”, which interpretation is safe?

Apply it elsewhere

Before adapting the chgrp workflow from “Owner review” to another server, what should you do?

Keep the momentum.

Complete the lab, then explain and apply the pattern.

Next: Passwd and group filesTry 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. 01Directory modesReview why private directories use tighter modes.Practice
  2. 02Passwd and group filesRead training account and group records.Practice
  3. 03Sudoers reviewRead a simulated sudoers drop-in without granting power.Practice