查看SELinux状态及关闭SELinux ⼀、查看SELinux状态:
1、我们可以通过查看配置⽂件的命令 cat /etc/linux/config 来查看状态
[root@lill ~]# cat /etc/linux/config
游仙诗# This file controls the state of SELinux on the system.
# SELINUX= can take one of the three values:
# enforcing - SELinux curity policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=enforcing
# SELINUXTYPE= can take one of the two values:
脚本生成器澳大利亚欧泊# targeted - Targeted process are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
发现SELinux共有3个状态enforcing (执⾏中)、permissive (不执⾏但产⽣警告)、disabled(关闭)。2,也可以⽤这个命令检查:getenforce
[root@localhost /]# getenforce
Enforcing
3、也可以⽤下述命令;如果SELinux status参数为enabled即为开启状态
人参作用[root@localhost /]# /usr/sbin/status -vadvice用法
SELinux status: enabled
⼆、关闭SELinux:
寻梦环游记英文社会主义道德建设的核心1、临时关闭(重启机器后失效):
#tenforce 0设置为permissive模式;tenforce 1 设置为enforcing模式;
静成语
tenforce 0
2、永久关闭(需要重启机器):
d -i s#SELINUX=enforcing#SELINUX=disabled# /etc/linux/config
重启机器即可