From the course: Red Hat Certified System Administrator (EX200) Cert Prep: 2 File Access, Storage, and Security

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Special directory bits: SGID and Sticky

Special directory bits: SGID and Sticky

From the course: Red Hat Certified System Administrator (EX200) Cert Prep: 2 File Access, Storage, and Security

Start my 1-month free trial

Special directory bits: SGID and Sticky

- [Instructor] We can apply Special Bits on Directories just like we can do files. However, the behavior is different for directories. Set user ID or SUID has no effect on directories. Set Group ID or SGID provides group inheritance for files and directories created inside the directory. Unlike with executables, the sticky bit works on directories in Linux. When the sticky bit is set for a directory, only the owners of the files can delete them. It might be easier to show you how SGID works on directories rather than try to explain it. After I've shown you we can talk about it. In a terminal, let's create a directory and slash home for this exercise using MK DIR. Type in CD space slash home, and hit enter. Be sure that you are in slash home, and not your user's home directory. You can verify with PWD, now type sudu, space, MK dir, space accounting, and hit enter. Now let's verify it again with LS space dash L and hit enter. You can see that since we created it using sudu, it's owned…

Contents