Linux Labs

Users, permissions, and processes / Stage 4 of 13

A shared directory: setgid, sticky, and umask

Not running Starting usually ~20 s
Leave the lesson

Step 6 of 7 · lab · 25 minmedium

The team's shared directory

Colleagues cannot append to alice's documents in the shared directory, and bob deleted her report while tidying up his own. Set up the team's directories so that editing together and handing in reports both work.

Situation

The devs team, alice and bob, works in the /srv/team directory:

  • /srv/team/docs holds documents the team edits together;
  • /srv/team/reports holds reports: everyone drops their own there.

This week's complaints. bob: "I can't append to alice's plan.md: Permission denied. And I can't create my own document in docs." alice: "My report disappeared from reports: bob deleted it while sorting his own. And nobody but me can edit my new documents."

You don't need alice's or bob's passwords: sudo -u runs commands on their behalf, and sudo -iu runs them the way their login does.

Task

  1. New files by alice and bob in /srv/team/docs get the devs group.
  2. bob can append to a new document that alice creates after logging in.
  3. bob can append to /srv/team/docs/plan.md, and alice stays the file's owner.
  4. bob cannot delete or rename alice's report in /srv/team/reports.
  5. alice and bob can put their own reports into /srv/team/reports, and new reports get the devs group.
  6. Others outside devs get no write access: not to docs or reports, not to plan.md, and not to alice's new files.

The machine has no internet access; everything you need is already installed.

Lab · on your own

No commands are given in this lab: type them in the terminal yourself. Goals are checked on the machine after every command.

Goals

0 of 6
  • New files by alice and bob in /srv/team/docs get the devs group — not done yet
  • bob can append to a new document alice created after logging in — not done yet
  • bob can append to /srv/team/docs/plan.md, and alice still owns it — not done yet
  • bob cannot delete or rename alice's report in /srv/team/reports — not done yet
  • alice and bob can put reports into /srv/team/reports, and new reports get the devs group — not done yet
  • Others cannot write to docs, reports, plan.md, or alice's new files — not done yet
Ctrl+Enter
Starts the machine node1 · Ubuntu 24.04

The machine is starting

Hints

0 of 3

Lab goals

0 of 6
  • New files by alice and bob in /srv/team/docs get the devs group — not done yet
  • bob can append to a new document alice created after logging in — not done yet
  • bob can append to /srv/team/docs/plan.md, and alice still owns it — not done yet
  • bob cannot delete or rename alice's report in /srv/team/reports — not done yet
  • alice and bob can put reports into /srv/team/reports, and new reports get the devs group — not done yet
  • Others cannot write to docs, reports, plan.md, or alice's new files — not done yet
node1 Ubuntu 24.04

Lab goals

0 of 6
  • New files by alice and bob in /srv/team/docs get the devs group — not done yet
  • bob can append to a new document alice created after logging in — not done yet
  • bob can append to /srv/team/docs/plan.md, and alice still owns it — not done yet
  • bob cannot delete or rename alice's report in /srv/team/reports — not done yet
  • alice and bob can put reports into /srv/team/reports, and new reports get the devs group — not done yet
  • Others cannot write to docs, reports, plan.md, or alice's new files — not done yet
Loading…