Owner, group and umask

A file's owner and group, chown and chgrp, who may change them, and the umask, which removes permissions from 666 and 777 at creation.

  • 22 cards
  • 5 topics
  • Free

The outline, topic by topic

Each topic is weighted the way the exam weighs it.

  1. Concepts
  2. Questions
  3. Sort and link
  4. The numbers
  5. Scenarios

A few cards from the deck

  • File owner: what is it?

    Show the answer

    The user whose identity is recorded in a file's inode, and whose permission triplet applies to them.

    The creator is the owner at first. Only root can give a file to another user.

  • What mode does f, created by touch, get under this umask?

    ```bash
    umask 033
    touch f
    `

    • 644
    • 633
    • 744
    • 755
    Show the answer

    644

    You mask bit by bit, you do not subtract: 666 without the bits of 033 (x for the group, w and x for others) gives 644. A subtraction would give 633, which makes no sense.

  • A file is requested with mode … and a directory with mode …; the umask is then removed, bit by bit.

    Show the answer

    A file is requested with mode 666 and a directory with mode 777; the umask is then removed, bit by bit.

    touch, an editor or a > redirection ask for 666, with no x: their files are not programs. A compiler, though, asks for 777 for the executable it produces, and a directory needs x to be traversed.

  • Owning group: what is it?

    Show the answer

    The group recorded in a file's inode, whose members receive the second permission triplet.

    At creation it is the creator's primary group, unless the directory has the setgid bit. The owner can change it to a group they belong to.