我试图使用login.defs配置文件更改umask模式,但由于某些原因,它不会影响系统。
我就是这么做的:sudo nano /etc/login.defs
# The ERASECHAR and KILLCHAR are used only on System V machines.
# The ULIMIT is used only if the system supports it.
# (now it works with setrlimit too; ulimit is in 512-byte units)
#
# Prefix these values with "0" to get octal, "0x" to get hexadecimal.
#
ERASECHAR 0177
KILLCHAR 025
UMASK 027试图将UMASK 027更改为UMASK 007,它就会发生变化。
下一步:
# Enable setting of the umask group bits to be the same as owner bits
# (examples: 022 -> 002, 077 -> 007) for non-root users, if the uid is
# the same as gid, and username is the same as the primary group name.
#
# This also enables userdel to remove user groups if no members exist.
#
USERGROUPS_ENAB yes然后将USERGROUPS_ENAB yes更改为USERGROUPS_ENAB no,然后保存文件并进行注销和登录,并尝试创建一个文件,例如:
touch file ~/和文件的输出
stat -c %a ~/file644,而不是预期的640。我记得我在一段时间前就做过这件事,而且效果很好。
还有其他的解决办法或解释吗?
这是我的核心信息:
Linux 4.13.8-1-ARCH #1 SMP PREEMPT Wed Oct 18 12:11:48 CEST 2017 i686 GNU/Linux发布于 2017-10-31 19:06:59
谢谢你的评论谁曾经试图帮助我。因此,我碰巧通过更改umask 027文件使~/bashrc模式永久化。事实上,该文件中没有任何umask集,因此我在文本末尾添加了以下几行:
#umask mode
umask 027在系统注销和登录后,它似乎覆盖了整个系统的这条规则,现在新创建的文件具有640权限。
https://unix.stackexchange.com/questions/400475
复制相似问题