查看SELinux状态:linux
方法1bash
/usr/sbin/sestatus -v | grep "SELinux status:"
#输出结果是enabled为开启,disabled为关闭。ide
方法2spa
getenforce
#输出结果是permissive为关闭,enforcing为开启。orm
关闭SELinux:ci
一、临时关闭(不重启系统便可生效):get
setenforce 0it
##设置SELinux为permissive模式,即关闭SELinux;若是数字为1则设置SELinux为enforcing模式,即开 启SELinux class
二、永久生效(修改后须要重启系统才能生效)grep
修改/etc/selinux/config 文件,将SELINUX=enforcing改成SELINUX=disabled