From the course: Linux: Files and Permissions
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Initial permissions using umask - Linux Tutorial
From the course: Linux: Files and Permissions
Initial permissions using umask
- [Instructor] When files are created, initial permissions are applied automatically. These permissions are calculated based on a bit mask called umask. To see your 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. The umask can have either three characters or four. Feel free to add the leading zero or leave it off for standard permissions. Notice that the umask isn't the same format as numeric permission, such as 754 is actually upside down, since it's a mask. To calculate initial permissions we'll have to subtract the umask from maximum allowed initial permissions, based on whether the item is a file or a directory. For directories our maximum initial permission are 777, since having execute on a directory does not create a security risk. Let's use a umask of 022. Now let's subtract the umask from the…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Standard Linux permissions overview1m 52s
-
(Locked)
File and directory modes1m 16s
-
(Locked)
File ownership3m 14s
-
(Locked)
Permissions using numeric notation3m 2s
-
(Locked)
Permissions using symbolic notation4m 44s
-
(Locked)
Initial permissions using umask4m 30s
-
(Locked)
Special file bits: SUID and SGID4m 59s
-
(Locked)
Special directory bits: SGID and Sticky5m 53s
-
(Locked)
Challenge: Permissions2m 16s
-
(Locked)
Solution: Permissions4m 19s
-
(Locked)
-
-