Linux Labs

Users, permissions, and processes / Stage 1 of 13

Users, groups, and process identity

Not running Starting usually ~20 s
Leave the lesson

Step 1 of 7 · on a machine · 4 min

The weekly summary

What you will learn

  • Identify the user and groups of the current process.
  • Distinguish file ownership from command execution identity.
  • Explain sudo scope and test access as the intended account.

Monday morning. The weekly summary from the evening on-call shift is waiting in ~/reports, and you need to add your figures to it.

Start by opening it. The exercise sets up the directory with the summary and moves you into it.

Exercise · look

Open the weekly summary

In ~/reports, run the three commands in order and note what each one prints.

Sign in and start The machine is available after signing in
Check yourself 1 question

Why is cat summary.txt refused while sudo cat summary.txt prints the summary?

  • A damaged file would not read through sudo either: root's rights do not repair content. sudo cat prints the whole summary, so the file is intact and what differs is who reads it.

  • Linux does not lock a file while another program holds it open: several programs can read one file at once. "Permission denied" comes from the permission check.

  • The directory opens without sudo: ls ~/reports lists its contents. The refusal comes from the summary file itself.

The summary belongs to root and only its owner may read it, while cat runs as student and sudo cat runs as root.

Ubuntu 24.04
Loading…