From the course: Cert Prep: LPIC-1 Exam 101 (Version 5.0)

Unlock the full course today

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

Default permissions using umask

Default permissions using umask - Linux Tutorial

From the course: Cert Prep: LPIC-1 Exam 101 (Version 5.0)

Start my 1-month free trial

Default permissions using umask

- [Instructor] When files are created, default permissions are applied automatically. These permissions are calculated based on a bitmask called umask. To see a umask type into a terminal umask and hit enter. We can also view the umask in symbolic notation by using the -S option. Type in umask -S and hit enter. We can see that my umask is 0002, which equates to rwx for the user, rwx for the group and rx for other. Centos has different umasks for root and regular users. That's su the root and check the umask again. Type in su - root and hit enter. Type in root's password and hit enter again. Type in umask and hit enter again. You can see that root's umask is 0022, and my user's umask is 0002. Type in exit to go back to your user. Notice that the umask isn't the same format as numeric permissions such as 754, but is rather upside down. To calculate default permissions, we'll have to subtract the umask from maximum…

Contents