参考百度百科:
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命令:修改对象(文件)的安全上下文。比如:用户:角色:类型:安全级别。