Oh, you have Rocky 8. In el8 the umask is indeed set in both /etc/profile
and /etc/bashrc
.
In el9 it was reduced into only /etc/bashrc
as to set same thing in both is redundant.
[root@el8 ~]# grep umask /etc/profile /etc/bashrc
/etc/profile:# By default, we want umask to get set. This sets it for login shell
/etc/profile: umask 002
/etc/profile: umask 022
/etc/bashrc: # By default, we want umask to get set. This sets it for non-login shell.
/etc/bashrc: umask 002
/etc/bashrc: umask 022
You don’t want to edit those files, because they do come from RPMs. If the packages are ever updated … are those files flagged as “config” and keep your changes, or just overwrite?
Both files seem to source /etc/profile.d/*.sh
at the end. You can add file /etc/profile.d/eric.sh
with:
umask 022
That should do the trick.
Overall, why is 002 a problem for you?