点的意义

mil*_*ler 4 ls file-attributes xattr

我找到了一些Linux文件,当我输入时ls -lah,它会输出以下权限格式:

... 
drwxr-xr-x.  2 root    root  
...
-rw-rw-r--.  1 root    root 
...
Run Code Online (Sandbox Code Playgroud)

我想知道在权限格式结束时dot(-rw-rw-r--.)的含义是什么?

小智 13

所以不是ACL,来自 @Tom van der Lee 参考文献

+ (plus) suffix indicates an access control list that can control additional permissions.
. (dot) suffix indicates an SELinux context is present. Details may be listed with the command ls -Z.
@ suffix indicates extended file attributes are present.
Run Code Online (Sandbox Code Playgroud)

我的机器上的一个例子:

$ ls -l 35mm DNS-cache 
-rw-r--r--. 1 graeme graeme     60 Feb 27  2010 35mm
-rw-r--r--  1 graeme everyone 5193 Jun  1 14:45 DNS-cache
$ 
$ getfacl -s 35mm DNS-cache 
$ ls -Z  35mm DNS-cache 
unconfined_u:object_r:user_home_t:s0 35mm
                                   ? DNS-cache
Run Code Online (Sandbox Code Playgroud)

因此getfacl -s没有产生输出,因为没有 ACL。然而,有一个安全上下文(用ls -Z看到)


Sid*_*kla 9

从 GNU.org列出的信息如下

GNU ls 使用 '.' 字符以指示具有 SELinux 安全上下文的文件,但没有其他替代访问方法。

这基本上意味着该文件具有SELinux的访问控制列表 (ACL)。您可以使用以下setfacl命令设置或删除文件的 ACL 关联


pho*_*xis 7

info coreutils 'ls invocation'Linux下

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.


小智 6

根据文件系统权限维基页面,点表示存在 SELinux 上下文。