点在-rw-r--r--`的末尾是什么意思?你如何用`chmod`设置它?


Answers:



36

我有同样的问题。我花了一段时间才找到了它,已经浏览了“ man ls”页面一百次(嗯,也许不是那么频繁),直到我终于在SEE ALSO部分中看到了有关使用命令的注释:

 info coreutils 'ls invocation'

在描述“ -l”(-format = long)的部分中:

 Following the file mode bits is a single character that specifies
 whether an alternate access method such as an access control list
 applies to the file.  When the character following the file mode
 bits is a space, there is no alternate access method.  When it is
 a printing character, then there is such a method.

 GNU `ls' uses a `.' character to indicate a file with an SELinux
 security context, but no other alternate access method.

 A file with any other combination of alternate access methods is
 marked with a `+' character.


11

这是SELinux上下文。尝试ls -Z /your/file

引用我的 man ls

   SELinux options:

   --lcontext
          Display security context.   Enable -l. Lines will probably be too wide for most displays.

   -Z, --context
          Display security context so it fits on most displays.  Displays only mode, user, group, security context and file name.

   --scontext
          Display only security context and file name.

要更改此设置,请尝试以下命令之一:chconsemanage fcontextrestorecon

相当整洁的解释在这里:https : //access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Security-Enhanced_Linux/sect-Security-Enhanced_Linux-Working_with_SELinux-SELinux_Contexts_Labeling_Files.html


2

这很可能是由于访问控制列表(ACL)虽然我只看到他们显示为+rw-rw-rw-+。也许这.意味着该文件上缺少ACL。

您可以尝试getfacl .在当前目录中键入以查看这些文件可能具有的访问控制。


3
否,该点并不意味着缺少
ACL-
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.