將SELINUX配置文件設置為 disabled 模式,禁用SELinux
vim /etc/selinux/config
SELINUX=disabled
使用sed
sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config
驗證
[root@MongoDB ~]# grep "SELINUX=disabled" /etc/selinux/config SELINUX=disabled
然后reboot重啟生效
工作中linux不能重啟 命令先臨時關閉
getenforce 查看當前selinux的級別狀態
配置好配置文件,使用命令臨時生效
setenforce 0 #使配置立即生效