Linux之selinux安全上下文

查看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: 列出所有的布尔值(也就是策略中的具体规则名称&

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值