>_ IzzyLab

Hands-on task

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

A report directory for the analysts

medium~10 min

kate prepares the reports, and her fellow analysts should only read them. Create the group analysts, the user kate with a home directory and membership in that group, and the directory /data/reports owned by kate:analysts with permissions 750: kate writes, the group reads and enters, others can't get in.

What you'll practise:
  • groupadd
  • useradd -G
  • chown
  • chmod 750
  • group access

Topic breakdown

Team access in Linux is built on groups: the directory owner gets their own triplet of permissions, all group members get the second, everyone else the third. For a group to read a directory's contents it needs r (to see the list of files) and x (to enter and open files), and without w it can't create or delete anything there. The setup takes several commands: groupadd creates the group, useradd with the supplementary-groups flag creates the user, and mkdir, chown owner:group and chmod build the directory itself.

What's checked

  1. group analysts created
  2. kate is a member of analysts
  3. kate has a home directory
  4. /data/reports is kate:analysts, permissions 750

What it looks like