查看SELinux狀態:
1、/usr/sbin/sestatus -v ##如果SELinux status參數爲enabled即爲開啓狀態 SELinux status: enabled sestatus ##直接執行命令 SELinux status: enabled2、getenforce ##也可以用這個命令檢查 enabled
關閉SELinux:
1、臨時關閉(不用重啓機器): setenforce 0 ##設置SELinux 成爲permissive模式 setenforce 1 ##設置SELinux 成爲enforcing模式 2、修改配置文件需要重啓機器: 修改/etc/selinux/config 文件 將SELINUX=enforcing改爲SELINUX=disabled
關閉SELinux免重啓:
1、sed -i 's/^SELINUX=\(.*\)/SELINUX=disabled/g' /etc/selinux/config && setenforce 0setenforce: SELinux is disabled2、sed -i 's/^SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config && setenforce 0setenforce: SELinux is disabled