靚麗時尚館

位置:首頁 > 健康生活 > 心理

redhat檢視防火牆是否開啟

心理3.29W
redhat檢視防火牆是否開啟

Redhat使用了SELinux來增強安全

首先怎麼檢視防火牆的狀態呢

a.可以通過如下命令檢視iptables防火牆狀態:

chkconfig --list iptables

b. selinux狀態可以通過以下命令檢視:

sestatus或者/usr/sbin/sestatus [-v]

selinux關閉的辦法為:

1、 永久有效

修改 /etc/selinux/config 檔案中的 SELINUX="enforcing" ,設定為 disabled ,然後重啟系統。

也可以在/etc/sysconfig/selinux中配置SELINUX=disabled,來關閉selinux,然後重啟系統。

2、 即時生效

setenforce 0 ---不需要重啟系統,但是臨時的。其中,0表示設定SELinux 成為permissive模式,1表示設定SELinux 成為enforcing模式

關閉防火牆的方法為:

1、 永久性生效

開啟:chkconfig iptables on

chkconfig ip6tables off ---針對ipv6

關閉:chkconfig iptables off

chkconfig ip6tables off ---針對ipv6

2、 即時生效,重啟後失效

開啟:service iptables start

關閉:service iptables stop

補充:

需要說明的是對於 Linux 下的其它服務都可以用以上命令執行開啟和關閉操作