午夜指挥官不尊重umask

gor*_*orn 5 configuration umask mc

当我在午夜指挥官中创建新文件并保存它(Shift + F4,写点东西,F2,命名文件)时,即使我的umask设置为0007,它也会创建640个,因此应该使用权限660创建它.有没有秘密的地方设置mc umask?我没找到一个.

R.S*_*art 0

为了使用您的 umask,您应该停用“保留权限”选项。

有关更多信息,请查看man并搜索 umask:

Preserve attributes

   determines whether to preserve the permissions, timestamps and (if  you
   are  root)  the ownership of the original files.  If this option is not
   set, the current value of the umask will be respected.
Run Code Online (Sandbox Code Playgroud)

mc 由您的用户执行,因此创建新文件的 umask 将是 ~/.bashrc 中配置的默认 umask 。

为了设置 umask 0007,请编辑 ~/.bashrc 并添加以下行:

掩码0007 

之后,重新启动 mc 并测试新文件的创建。

我在 debian jessie 上的 docker 容器中测试了上面的设置,并且工作正常。

您可以在这里找到有关 umask 的更多详细信息: http://www.cyberciti.biz/tips/understanding-linux-unix-umask-value-usage.html