From the course: Linux CentOS 7: Files and Permissions

Unlock the full course today

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

Default permissions using umask

Default permissions using umask - Linux Tutorial

From the course: Linux CentOS 7: Files and Permissions

Start my 1-month free trial

Default permissions using umask

- [Narrator] 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 subvalue notation, using the dash capital S option. Type in umask space dash capital 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 route and regular users. Let's s root and check the umask again. Type in su space hyphen space 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 position such as 754 but is rather upside down. To calculate default permissions, we'll have to subtract the umask, from maximum initial permissions. For…

Contents