The umask
biasanya sistem yang luas diatur melalui file konfigurasi: /etc/login.defs
:
$ grep UMASK /etc/login.defs
UMASK 077
Nilai ini dapat diganti tetapi biasanya tidak melalui salah satu /etc/bashrc
, /etc/profile
dan / atau oleh pengguna di $HOME/.bashrc
(anggap mereka menggunakan Bash).
Jika Anda grep
untuk "umask" di file-file tersebut Anda juga akan melihat ini di kotak RHEL:
$ grep umask /etc/bashrc /etc/profile
/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
/etc/profile:# By default, we want umask to get set. This sets it for login shell
/etc/profile: umask 002
/etc/profile: umask 022
Menggali lebih dalam:
/etc/bashrc
# By default, we want umask to get set. This sets it for non-login shell.
# Current threshold for system reserved uid/gids is 200
# You could check uidgid reservation validity in
# /usr/share/doc/setup-*/uidgid file
if [ $UID -gt 199 ] && [ "`id -gn`" = "`id -un`" ]; then
umask 002
else
umask 022
fi
/etc/profile
# By default, we want umask to get set. This sets it for login shell
# Current threshold for system reserved uid/gids is 200
# You could check uidgid reservation validity in
# /usr/share/doc/setup-*/uidgid file
if [ $UID -gt 199 ] && [ "`id -gn`" = "`id -un`" ]; then
umask 002
else
umask 022
fi
Jadi setidaknya pada sistem RHEL umask
adalah apakah 002
jika UID Anda lebih besar dari 199, dan 022
sebaliknya (akun sistem).