SUID, SGID, the sticky bit and a shared directory
Sign in to read this lesson
A classic RHCSA task: "create a directory where group members work together: new files must belong to the group, and nobody may delete someone else's file". In this lesson we review the three special bits in the RHEL context and solve this task step by step.
What you will learn
- SUID (4000) runs a program as the file's owner; SGID (2000) on a directory gives new files the directory's group; sticky (1000) lets only the owner delete.
- The shared-directory recipe:
chgrp group,chmod 2770(or3770with sticky). - In
ls -lyou sees(with x),S(without x — usually a mistake),t/T. - Find SUID/SGID files with
find / -perm /6000 -type f— a security audit. - For a group member to see a new group, a fresh login or
newgrpis needed.
The lesson has 5 key points, an explanation and 5 questions. It opens with a package.