SELinux总结

参考百度百科:

SELinux 是 2.6 版本的 Linux 内核中提供的强制访问控制(MAC)系统;
SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX有「disabled」「permissive」,「enforcing」3种选择。
Disabled:禁用
Permissive:就是Selinux有效,但是即使你违反了策略的话它让你继续操作,但是把你的违反的内容记录下来。在我们开发策略的时候非常的有用。
Enforcing:违反了策略,就无法操作

模式切换
1)getenforce   得到当前的SELINUX值  [root@python bin]# getenforce   Permissive
2)setenforce   更改当前的SELINUX值 ,后面可以跟 enforcing,permissive 或者 1,0。
[root@python bin]# setenforce permissive   
3)sestatus   显示当前的 SELinux的信息   
[root@python bin]# sestatus -v   
SELinux status: enabled   
SELinuxfs mount: /selinux   
Current mode: permissive   
Mode from config file: permissive   
Policy version: 20   
Policy from config file: refpolicy   
Process contexts:   
......

4)chcon命令:修改对象(文件)的安全上下文。比如:用户:角色:类型:安全级别。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值