绿色资源网

电脑版
提示:原网页已由神马搜索转码, 内容由www.downcc.com提供.
您的位置:首页操作系统linux→ Linux开启防火墙及开启和查看已开启端口

Linux开启防火墙及开启和查看已开启端口

我要评论2012/09/26 01:04:02 来源:绿色资源网编辑:www.downcc.com 评论:0点击:238次

依次运行以下命令: 
/sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT #开启80端口
/sbin/iptables -I INPUT -p tcp --dport 22 -j ACCEPT #开启22端口
/etc/rc.d/init.d/iptables save #保存配置
/etc/rc.d/init.d/iptables restart #重启服务 

查看已开放端口
/etc/init.d/iptables status
结果如下
Table: filter
Chain INPUT (policy ACCEPT)
num target prot opt source destination
2 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:22
3 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:80

关键词:Linux,防火墙

相关阅读

阅读本文后您有什么感想? 已有 人给出评价!

  • 0

  • 0

  • 0

  • 0

  • 0

  • 0

用户评论

热门评论

最新评论

发表评论查看所有评论(0)

昵称:
请不要评论无意义或脏话,我们所有评论会有人工审核.
字数: 0/500(您的评论需要经过审核才能显示)

相关软件

热点图文

更多+

精品软件