在CentOS6.2 中安装intel 的c++和fortran 的编译器时,遇到来一个关于SELinux的强制模式不可执行的情况,
需要关闭SELinux 或者 将enforcing改为 permissive 模式,查询来一些资料后,先对SELinux的几种模式,以及其之间的关系和转换方法做一小结,以备以后查看和学习。
SELinux 的启动、关闭与查看
1、并非所有的 Linux distributions 都支持 SELinux
目前 SELinux 支持三种模式,分别如下:
•enforcing:强制模式,代表 SELinux 运作中,且已经正确的开始限制 domain/type 了; •permissive:宽容模式:代表 SELinux 运作中,不过仅会有警告讯息并不会实际限制 domain/type 的存取。这种模式可以运来作为 SELinux 的 debug 之用;
•disabled:关闭,SELinux 并没有实际运作。
2,查看SELinux的模式
getenforce Enforcing <==就显示出目前的模式为 Enforcing
3,查看 SELinux 的政策 (Policy)?
[root@master oracle]# sestatus
SELinux status: enabled <==是否启动 SELinux
SELinuxfs mount: /selinux <==SELinux 的相关文件资料挂载点
Current mode: enforcing <==目前的模式
Mode from config file: enforcing <==设定档指定的模式
Policy version: 21
Policy from config file: targeted <==目前的政策为何?
4,通过配置文件调整SELinux的参数
[root@www ~]# vi /etc/sel