您現在的位置是:首頁 > 運動

Linux關閉防火牆和Selinux

由 程式設計師鼕鼕 發表于 運動2022-08-09
簡介開機時自動開啟防火牆systemctl enable firewalldSelinux關閉檢視selinux狀態getenforce#返回結果除了Enforcing這個狀態之外的狀態其他都是關閉狀態2

網咖關閉防火牆會怎麼樣

Linux關閉防火牆和Selinux

1。檢視防火牆狀態

systemctl status firewalld

2。臨時關閉防火牆

systemctl stop firewalld

3。開機啟動關閉防火牆(永久關閉)

systemctl disable firewalld

4。開啟防火牆

systemctl start firewalld

5。開機時自動開啟防火牆

systemctl enable firewalld

Selinux關閉

檢視selinux狀態

getenforce #返回結果除了Enforcing這個狀態之外的狀態其他都是關閉狀態

2。關閉selinux

vi /etc/sysconfig/selinux

將下面的 SELINUX 改成disabled即為關閉

然後重啟系統 reboot

# This file controls the state of SELinux on the system.

# SELINUX= can take one of these three values:

# enforcing - SELinux security policy is enforced.

# permissive - SELinux prints warnings instead of enforcing.

# disabled - No SELinux policy is loaded.

SELINUX=disabled

# SELINUXTYPE= can take one of three values:

# targeted - Targeted processes are protected,

# minimum - Modification of targeted policy. Only selected processes are protected.

# mls - Multi Level Security protection.

SELINUXTYPE=targeted

推薦文章