[root@localhost ~]# umask
0022
[root@localhost ~]# umask
0022
[root@localhost ~]# touch file <--新建file空文件
[root@localhost ~]# ll -d file
-rw-r--r--. 1 root root 0 Apr 18 02:36 file
[root@localhost ~]# umask
0022
[root@localhost ~]# mkdir catalog <--新建catalog目录
[root@localhost ~]# ll -d catalog
drwxr-xr-x. 2 root root 4096 Apr 18 02:36 catalog
[root@localhost ~]# umask 002
[root@localhost ~]# umask
0002
[root@localhost ~]# umask 033
[root@localhost ~]# umask
0033
[root@localhost ~]# vim /etc/profile
...省略部分内容...
if [ $UID -gt 199]&&[ "'id -gn'" = "'id -un'" ]; then
umask 002
\#如果UID大于199(普通用户),则使用此umask值
else
umask 022
\#如果UID小于199(超级用户),则使用此umask值
fi
…省略部分内容…
欢迎光临 黑帽联盟 (https://bbs.cnblackhat.com/) | Powered by Discuz! X2.5 |