[ norboten ]
linux · lab linux-05

The Shared Folder That Locks People Out

· about 25 minutes · runs on ubuntu-26.04-container · unrated

An unrated lab. It runs on your machine with no account and no network, and everything about it — the faults, the checks, the hints and the reference solution — is in the repository. An attempt on it is recorded on your profile and never moves a rating: only rated labs do. Rated and unrated labs.

The briefing

The reports team — alice, bob and carol, as /srv/reports/TEAM.txt says — shares /srv/reports. It has never worked. Whoever writes a report is the only one who can change it; carol cannot open half the files at all; and dave, a contractor who is not on the team, reads all of it. A previous admin "hardened" logins last year, and things got worse.

This lab runs in a container, not a VM: there is no boot and nothing to reboot. You are learner with sudo. su - alice (or bob, carol, dave) is how to see the folder through someone's eyes — the grader looks at it that way too.

What is expected, and graded:

  1. alice, bob and carol are in the group reports; dave is not.
  2. Each of them can read and change every file and directory already in /srv/reports.
  3. A file or directory any of them creates there later belongs to reports, and the other two can read and change it — without anyone running chmod afterwards.
  4. dave cannot list /srv/reports or read anything in it.

Do not solve it with chmod 777: that fails the fourth, and it fails your next audit.

What is graded

This lab runs in a container — Docker or Podman, no VM — so there is no boot to survive: the checks run once, against the state you left.

CheckObjective
01_the_whole_team_is_in_the_groupPut exactly the right people in a group
02_the_team_can_edit_every_fileGive a group read and write access to files that already exist
03_new_files_stay_sharedMake files created later belong to the group and stay editable by it
04_outsiders_cannot_readKeep everyone outside the group out

Start it

  1. 2Labs
  2. linux-05select this one
  3. udownload it
  4. sstart the machine

Reading

Where the lab's hints send you, level by level, as you ask for them (h, then l opens a journal section in the TUI).

Theory for this lab

4 questions on the same topic, in the lab's Theory tab. They never affect the lab's grade. Three of them, to answer here:

Question 1

alice owns plan.txt, mode 0460 (r--rw----), group reports, and alice is a member of reports. What can alice do with the file?

Question 2

What does this print?

umask 077
touch f
mkdir d
echo "$(stat -c %a f) $(stat -c %a d)"
Question 3

/srv/reports is drwxrws--- root:reports. alice, in reports, creates a file there with umask 077 and no ACLs. What are its group and mode?