Linux Labs

Users, permissions, and processes / Stage 2 of 13

File and directory permissions

Not running Starting usually ~20 s
Leave the lesson

Step 5 of 6 · on a machine · 5 min

The whole path is checked

To open a file, a process passes through every directory on the path. If any of them lacks x, the file is closed, whatever its own permissions say.

The kernel checks the path /srv/permissions-lab/archive/note.txt piece by piece: /, srv, permissions-lab, and archive need passage, x, for the process, and note.txt needs the action itself, r. In the previous step the check stopped at archive.

namei with -l prints the permissions of every part of a path at once, one line per directory and one for the file itself:

bash
namei -l /etc/nginx/nginx.conf

Look for the denial as the account that needs access. You test someone else's read with sudo -u account — that is how you read the report as www-data. Compare the directory where the denial happens with the triple that applies to that account.

Exercise · do it

Where the service's path breaks

The web server runs as www-data and must serve /srv/permissions-lab/site/2026/q4/index.html, but it is refused. Do not change any permissions: find the directory www-data cannot pass through and write its full path to ~/answer.txt.

Sign in and start The machine is available after signing in

Goals · 0 of 2

  • Find the directory where www-data's path breaks and write it to answer.txt not done yet
  • Leave the directory permissions as they were not done yet

Step goals

0 of 2
  • Find the directory where www-data's path breaks and write it to answer.txt — not done yet
  • Leave the directory permissions as they were — not done yet
Ubuntu 24.04

Step goals

0 of 2
  • Find the directory where www-data's path breaks and write it to answer.txt — not done yet
  • Leave the directory permissions as they were — not done yet
Loading…