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,防火墙
相关阅读
- 04-09红旗Linux 6.0桌面版下载地址集合(sp1,sp2,sp3)
- 09-26Linux 重启命令
- 09-03linux中文文件名乱码的解决办法(安装中文支持包)
- 07-09LINUX安全加固
- 07-09Linux远程管理器xshell和xftp使用教程
- 11-18linux下FTP、SFTP命令详解
- 02-15linux sftp介绍
- 04-17Linux VPS CentOS 5 实例图解搭建网站(新手必看)
- 08-27Linux安装配置maven以及搭建nexus服务器
- 04-04Linux 防火墙配置基础篇