Chinaunix

标题: 权限位问题 [打印本页]

作者: kinnix    时间: 2017-04-17 11:52
标题: 权限位问题
# ls -l examplefile -rwxr-xr-x. 1 root root 0 May 31 03:57 examplefile


请问有人知道 -rwxr-xr-x. 最后这个点 是代表什么意思吗? 谢谢。


作者: 钟良    时间: 2017-04-17 21:00
这个点没有意义
作者: qq58945591    时间: 2017-04-17 22:19
kinnix 发表于 2017-04-17 11:52
# ls -l examplefile -rwxr-xr-x. 1 root root 0 May 31 03:57 examplefile

这个跟SElinux 有关系。

作者: lyhabc    时间: 2017-04-26 17:30
开启了SELinux功能的Linux系统才会有这个点。
那个点表示文件带有“SELinux的安全上下文”。
CentOS7默认是开启SELinux的,所以会有这个点,
如果关闭SELinux,然后再创建文件,新创建的文件就不会再有这个点了,
但是以前创建的文件本来有这个点的还会显示这个点(虽然SELinux不起作用了)。

参考下边命令应该能得到答案

$info coreutils 'ls invocation'
1
1
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.
在文件权限位后面,附加有一个单字符。用来表示是否有一个
可替换的访问控制措施应用在这个文件上。例如,访问控制列表(ACL,access control list)。
当文件权限位后面附加的是一个空格时,表示系统没有可替换的访问控制措施。
当是一个可打印字符时,表示系统存在这样一个访问控制措施。

GNU ‘ls’ uses a ‘.’ character to indicate a file with an SELinux
security context, but no other alternate access method.
GNU的ls命令使用 ‘.’字符表示文件使用了SELinux安全上下文,
但是没有使用其他的访问控制措施。

A file with any other combination of alternate access methods is
marked with a ‘+’ character.
一个文件结合了其他访问控制措施,文件用‘+’字符标记 。(如:ACL)

一个文件就算没有SELinux上下文,只用应用ACL,也能标记成‘+’字符。
一个文件有SELinux上下文,也有ACL,也标记成‘+’字符。




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2