6. Setgid

Similar to the set user ID permission bit, there is a set group ID (SGID) permission bit. This bit allows a program to run as if it were a member of that group.

Let's look at one example:

$ ls -l /usr/bin/wall
-rwxr-sr-x 1 root tty 19024 Dec 14 11:45 /usr/bin/wall

We can now see that the permission bit is in the group permission set.

Modifying SGID

sudo chmod g+s myfile
sudo chmod 2555 myfile

The numerical representation for SGID is 2.

Sign in to save your learning progress

Sign in

Exercises

Practice makes perfect! Here are some hands-on labs to reinforce your understanding of Linux user, group, and file permissions:

  1. Linux User Group and File Permissions - Learn essential Linux user and group management concepts, including creating and managing users, exploring group memberships, understanding file permissions, and manipulating file ownership.
  2. Add New User and Group - Practice creating new user accounts, setting up custom groups, and managing group memberships, simulating real-world system administration tasks.

These labs will help you apply the concepts in real scenarios and build confidence with Linux permissions and user management.

Quiz

What number represents the SGID?