From the course: Linux CentOS 7: Files and Permissions

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 - Linux Tutorial

From the course: Linux CentOS 7: Files and Permissions

Start my 1-month free trial

Special directory bits: SGID and Sticky

- [Instructor] SGID and Sticky are special bits for directories. In a terminal, let's create a directory in /home for this exercise using mkdir. Type in cd /home and hit Enter. Now type in sudo mkdir accounting and hit Enter again. Type in your Password and hit Enter a third time. Let's verify this by typing in ls -l, and we can see that the accounting directory exists, and is owned by the root user in the root group. The reason it's owned by the root user in the root group, is because we elevated privileges when we created it. The permissions for the user owner are rwx, the group owner is rx and for other is rx. Now let's create a group called Accounting. Type in sudo groupadd accounting and hit Enter. Now let's change the ownership of our accounting directory to the accounting group. Type in sudo chown, which is change owner, space :accounting, that's the accounting group, space accounting. So you should have sudo chown space :accounting accounting, hit Enter. Let's verify this with…

Contents