Ubuntu使用小技巧umask设置及已存在的域名重导向设置
Ubuntu使用小技巧umask设置及已存在的域名重导向设置
今天涨了一个见识,一直以为在dns服务器里面不能对cn等已经存在的域名设置ip,结果今天试了下,直接设置 一个 xx.yy.cn的域,然后设置一个和区域相同的主机头就行了,真是!
Ubuntu设置mask值
由于服务器上proftp软件被我卸载了,现在同事上传资料都通过ssh自带的openserver来上传,可这样,控制权限又成为了一个问题,主要的就是,一个同事上传的文件,默认掩码为644,其他同事不能更改(为了控制权限,每个同事用户名不同)。以前在ftp软件里很容易设置umask值,可这个sshd里面怎么设置还挺麻烦的,试了网上常说的/etc/profile ~/.profile 文件都不好使,因为 我设置的用户名都没有家目录,自然也就没有~/.profile文件。
Vim /etc/profile里面一段
# The default umask is now handled by pam_umask.
# See pam_umask(8) and /etc/login.defs.
if [ -d /etc/profile.d ]; then
for i in /etc/profile.d/*.sh; do
if [ -r $i ]; then
. $i
fi
done
unset i
fi
又查 man pam_umask
DESCRIPTION
pam_umask is a PAM module to set the file mode creation mask of the current
environment. The umask affects the default permissions assigned to newly
created files.
The PAM module tries to get the umask value from the following places in
the following order:
umask= argument
umask= entry in the user‘s GECOS field
UMASK= entry from /etc/default/login
UMASK entry from /etc/login.defs (influenced by USERGROUPS_ENAB in
/etc/login.defs)
终于在 vim /etc/login.defs里找到目标
# If USERGROUPS_ENAB is set to "yes", that will modify this UMASK default value
# for private user groups, i. e. the uid is the same as gid, and username is
# the same as the primary group name: for these, the user permissions will be
# used as group permissions, e. g. 022 will become 002.
#
# Prefix these values with "0" to get octal, "0x" to get hexadecimal.
#
ERASECHAR 0177
KILLCHAR 025
UMASK 022 > 002
测试,新建的文件都是 775的权限,至此修改完成。
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。