Linux Labs

Users, permissions, and processes / Stage 2 of 13

File and directory permissions

Not running Starting usually ~20 s
Leave the lesson

Step 3 of 6 · on a machine · 5 min

One triple applies

For each operation the kernel picks one triple for the process and looks only at it. The order of that choice explains why the owner was refused.

The choice goes in order. If the process's UID matches the file's owner, the owner triple applies. If not, but the file's group is among the process's groups, the group triple applies. Otherwise, the others triple. Triples do not add up: once a triple is found, the kernel ignores the other two.

The report belonged to student, so your cat got the owner triple ---. There was an r in the line, but in someone else's triple. www-data is neither the owner nor in the student group, so the others triple r-- applied to it.

The next file, team.txt, belongs to root, and its group is student. That is your primary group: id shows it.

Exercise · look

A file of the student group

You are in /srv/permissions-lab. Look at the line for team.txt, read the file yourself, and read it as www-data.

First, predict

The line for team.txt is -rw-r----- 1 root student. What will your cat team.txt print?

Now start the exercise, run the command and compare your prediction with the output.

Sign in and start The machine is available after signing in
Ubuntu 24.04
Loading…