>_ IzzyLab

Hands-on task

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

umask 007 for team directories

medium~5 min

The ops team works in shared group directories, and colleagues can't edit each other's files: new files are created without group write permission. Make it so that in new login sessions of any user the umask is 007: files — 660, directories — 770 (the group reads and writes, everyone else gets nothing). It's checked with a bash login shell, as with bash -l.

What you'll practise:
  • umask
  • default permissions
  • group write
  • /etc/profile.d
  • login shell

Topic breakdown

umask doesn't grant permissions, it takes them away: a new file starts from 666, a directory from 777, and the mask bits are subtracted from that. For teamwork in shared directories the typical mask is 007: the owner and the group keep read and write, while everyone else loses everything. Without it, a file created by one member can only be read by the rest of the group, and editing shared documents won't work. For the rule to apply to all users, it goes not into personal dotfiles but into /etc/profile.d/: the login shell picks up environment scripts from there.

What's checked

  1. umask in a login shell is 007
  2. new files are 660, directories 770

What it looks like