`

用命令行方式关闭CentOS防火墙

阅读更多

#/sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT  

#/sbin/iptables -I INPUT -p tcp --dport 22 -j ACCEPT  

#/etc/rc.d/init.d/iptables save 

重启计算机后,防火墙默认已经开放了80和22两个端口。

 

临时性的完全关闭防火墙,可以不重启机器:

#/etc/init.d/iptables status                ## 查看防火墙状态

#/etc/init.d/iptables stop                    ## 本次关闭防火墙

#/etc/init.d/iptables restart                ## 重启防火墙

永久性关闭防火墙:

#chkconfig --level 35 iptables off   ## 注意中间的是两个英式小短线;重启

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics