酷知百科網

位置:首頁 > 遊戲數碼 > 互聯網

CentOS7關閉防火牆和SELinux

互聯網3.21W

本文主要講述瞭如何在CentOS7上臨時關閉防火牆、永久關閉防火牆、臨時關閉SELinux和永久關閉SELinux的方法。
出自openstackblog。

防火牆(firewalld)

(01)臨時關閉防火牆systemctl stop firewalld

(02)永久防火牆開機自啓動systemctl disable firewalld

(03)臨時開啟防火牆systemctl start firewalld

(04)防火牆開機啓動systemctl enable firewalld

(05)檢視防火牆狀態systemctl status firewalld

SELinux

(01)臨時關閉SELinuxsetenforce 0

(02)臨時開啟SELinuxsetenforce 1

(03)開機關閉SELinux編輯/etc/selinux/config檔案,將SELINUX的值設定爲disabled,如下圖。下次開機SELinux就不會啓動了。

CentOS7關閉防火牆和SELinux

(04)檢視SELinux狀態執行getenforce命令