Back to practice tasks

practice task

Inspect Permissions Before chmod

An app cannot read a file and someone suggests chmod 777. You need to inspect the path, owner, group, and mode before changing permissions.

Independent study support only. No affiliation, endorsement, exam dumps, or guaranteed exam results.

Try first

namei -l /srv/app/current/.env

Goal

Show every path component and the target file permissions so the smallest safe fix is visible.

Expected output

A component-by-component permission view for each directory and the final file, including owner, group, and mode.

Teaches

File access depends on directory traversal permissions as well as the final file mode.

Common mistake

Applying chmod -R 777 to make the symptom disappear and creating a broader security problem.

command set

Commands to know

  1. namei -l /srv/app/current/.env
  2. stat /srv/app/current/.env
  3. ls -ld /srv /srv/app /srv/app/current

Watch this command run

Example output from a temporary Linux lab

next practice

Preview What rsync --delete Would Remove

You need to mirror a release directory to a backup target, but stale files on the target should be removed. Before running the real sync, you must preview deletions.