[Linux] 關閉防火牆以及開放端口


一.

service iptables stop 臨時關閉,

chkconfig iptables off完全關閉

service iptables status狀態,

service iptables start/restart 開啟/重啟防火牆

二.

輸入命令

iptables -I INPUT -p tcp --dport 22 -j ACCEPT

iptables -I INPUT -p tcp --dport 80 -j ACCEPT

iptables -I INPUT -p tcp --dport 3306 -j ACCEPT

iptables -I INPUT -p tcp --dport 8080 -j ACCEPT

iptables -I INPUT -p tcp --dport 6379 -j ACCEPT

來開放相關端口,分別是

XShell連接22 , 本地80, mysql 3306,tomcat 8080, redis 6379


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM