linux 系统在/etc/profile中设置不同用户的的umask值
55 # By default, we want umask to get set. This sets it for login shell 56 # Current threshold for system reserved uid/gids is 200 57 # You could check uidgid reservation validity in 58 # /usr/share/doc/setup-*/uidgid file 59 if [ $UID -gt 199 ] && [ "`/usr/bin/id -gn`" = "`/usr/bin/id -un`" ]; then 60 umask 002 61 else 62 umask 022 63 fi
从上面的代码中可以看出,UID大于199的用户设置了umask为002,否则为022。所以umask值对于root用户是022,对于普通用户是002