查询SeLinux状态
方法一、
getenforce
默认显示Enforcing
,如果是关闭则显示Disabled
方法二、
/usr/sbin/sestatus -v
第一行默认显示SELinux status: enabled
临时关闭
setenforce 0
永久关闭
vi /etc/selinux/config
将文件中的SELINUX=enforcing
改为SELINUX=disabled
然后重启机器生效,reboot
临时关闭:
[root@localhost ~]# getenforce
Enforcing
[root@localhost ~]# setenforce 0
[root@localhost ~]# getenforce
Permissive
永久关闭:
[root@localhost ~]# vim /etc/sysconfig/selinux
SELINUX=enforcing 改为 SELINUX=disabled
修改配置需要重启
[root@localhost ~]# reboot