Owner review
Change simulated owner and group labels on a web file.
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.htmlgroup www-data set on /srv/www/index.html
Exit status: 0. The command completed successfully in the training fixture.
$ stat /srv/www/index.htmlPath: /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.
Explain it
Apply it elsewhere
Keep the momentum.
Complete the lab, then explain and apply the pattern.
Next: Passwd and group filesTry 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.