本文主要講述了如何在CentOS7上臨時關閉防火牆、永久關閉防火牆、臨時關閉SELinux和永久關閉SELinux的方法。
出自openstackblog。
防火牆(firewalld)
-
臨時關閉防火牆
systemctl stop firewalld
-
永久防火牆開機自啟動
systemctl disable firewalld
-
臨時打開防火牆
systemctl start firewalld
-
防火牆開機啟動
systemctl enable firewalld
-
檢視防火牆狀态
systemctl status firewalld
SELinux
-
臨時關閉SELinux
setenforce 0
-
2
臨時打開SELinux
setenforce 1
-
3
開機關閉SELinux
編輯/etc/selinux/config檔案,将SELINUX的值設定為disabled,如下圖。下次開機SELinux就不會啟動了。
-
4
檢視SELinux狀态
執行getenforce指令