當前位置:首頁 » 操作系統 » linux防火牆埠關閉

linux防火牆埠關閉

發布時間: 2025-01-02 09:18:29

linux埠被防火牆關閉如何打開嗎

1) 重啟後生效

開啟: chkconfig iptables on

關閉: chkconfig iptables off

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

開啟: service iptables start

關閉: service iptables stop

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

在開啟了防火牆時,做如下設置,開啟相關埠,

修改/etc/sysconfig/iptables 文件,添加以下內容:

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT

重起iptalbes服務:service iptables restart

❷ 如何關閉linux防火牆的443埠

1、首先需要在Linux終端輸入指令:iptables -I INPUT -p tcp --dport 443 -j ACCEPT。

❸ linux如何關閉防火牆

關閉防火牆,就可以外部訪問了。不受埠限制。生產環境,最好開啟防火牆,開啟部分埠。
1.永久有效
開啟: chkconfig iptables on 關閉: chkconfig iptables off

2.即刻生效
開啟: service iptables start 關閉: service iptables stop

3.開啟部分埠
vim /etc/sysconfig/iptables

添加想要開啟的相關埠
-A INPUT -m state --state NEW -m tcp -p tcp --dport 6379 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8081 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8082 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
service iptables restart

更多詳細Linux知識可參考《Linux就該這么學》。

熱點內容
php辦公系統 發布:2025-07-19 03:06:35 瀏覽:900
奧德賽買什麼配置出去改裝 發布:2025-07-19 02:53:18 瀏覽:40
請與網路管理員聯系請求訪問許可權 發布:2025-07-19 02:37:34 瀏覽:189
ipad上b站緩存視頻怎麼下載 發布:2025-07-19 02:32:17 瀏覽:844
phpcgi與phpfpm 發布:2025-07-19 02:05:19 瀏覽:527
捷達方向機安全登錄密碼是多少 發布:2025-07-19 00:57:37 瀏覽:692
夜魔迅雷下載ftp 發布:2025-07-19 00:39:29 瀏覽:99
增值稅票安全接入伺服器地址 發布:2025-07-19 00:20:45 瀏覽:486
solidworkspcb伺服器地址 發布:2025-07-18 22:50:35 瀏覽:822
怎麼在堆疊交換機里配置vlan 發布:2025-07-18 22:42:35 瀏覽:630