查看selinux安全上下文:ls -Z
[root@localhost ~]# touch /var/ftp/hellohello 新建文件测试
[root@localhost ~]# ls /var/ftp/ 查看目录ftp中的内容
hellohello pub
[root@localhost ~]# touch /mnt/haha1
[root@localhost ~]# mv /mnt/haha1 /var/ftp/haha1 #复制是新建的过程,移动是重命名的过程,文件系统权限和属性不会改变
[root@localhost ~]# getenforce
Enforcing
[root@localhost ~]# cd /var/ftp
[root@localhost ftp]# ls -Z
-rw-r--r--. root root unconfined_u:object_r:mnt_t:s0 haha1 #安全上下文为mnt_t
-rw-r--r--. root root system_u:object_r:public_content_t:s0 hellohello #安全上下文为public_content_t
drwxr-xr-x. root root system_u:object_r:public_content_t:s0 pub
system_u:object_r:public_content_t:s0
对应 身份:角色:类型:灵敏度
命令: seinfo [选项]
选项:
-u: 列出SELinux中所有的身份(user)
-r: 列出SELinux中所有的角色(role)
-t: 列出SELinux中所有的类型(type)
-b: 列出所有的布尔值(也就是策略中的具体规则名称&