>_ IzzyLab

Hands-on task

This task is step 9 of the course “Users, groups and permissions”

A handoff folder for ops

easy~3 min

The on-call engineers from the ops group pass notes to each other through the directory /srv/handoff. Create it with the group ops and permissions 1770: group members can write, only a file's author can delete it (sticky bit), others can't get in.

What you'll practise:
  • sticky bit
  • chmod
  • chgrp
  • group directories
  • special bits

Topic breakdown

In Linux, the right to delete a file comes from write access to the directory, not from owning the file, so in a shared folder any member can wipe out someone else's work. The sticky bit on a directory restricts this: only the file's owner (and root) can delete or rename it. In octal notation sticky is the leading fourth digit 1. In ls -ld it shows as t in place of the others' x, and if others have no x — as a capital T. The directory's group is set with chgrp or chown :group.

What's checked

  1. /srv/handoff created
  2. directory group is ops
  3. permissions are 1770 (sticky bit)

What it looks like