Default Permissions and umask
One objective. The arithmetic is simple once you know files start from 666 and directories from 777 - and that the umask *removes* bits rather than granting them, which is why a new file is never executable however permissive the umask.
Security and SELinux Guide 54 of 67 Beginner
- OSRHEL 10.0
- Kernel6.12.0-55.9.1.el10_0
- dnf4.20.0
- Flatpak1.16.0
- TimeAbout 10 min
Two places set it and they are not interchangeable. /etc/login.defs UMASK is applied by pam_umask at login, for any session. /etc/profile and /etc/bashrc set it for shells. RHEL 10's default is 022 for root and 002 for ordinary users, because of the user private group scheme.
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| RHCSA-A01 | 192.168.0.31 | RHEL 10.0 | Practice node (graded) - spare /dev/sda | 2 Core | 4 GB | 50 GB + 15 GB |
This guide includes
Use this for one objective that stays easy until it has to persist. This matters because umask subtracts rather than sets - and making it stick means finding which of several files actually applies to you.
- reading what umask does, in octal and in symbolic form
- changing it, and seeing the effect on a new file and a new directory
- making it persist, and finding which file actually applies
Before you start
- A shell.
- The session writes and removes
/tmp/umtest.
-
What it does
-
Changing it
-
Making it stick