centos iptables设置22、80端口
来源:互联网 发布:excel如何拆分数据公式 编辑:程序博客网 时间:2024/06/06 11:25
【设置仅22、80端口可访问】
通过命令 netstat -tnl 可以查看当前服务器打开了哪些端
查看防火墙设置
开放22、80端口
取消其他端口的访问规则
允许本地回环接口(即允许本机访问本机)
允许已建立的或相关连的通行(如数据库链接)
允许所有本机向外的访问
保存配置:
通过命令 netstat -tnl 可以查看当前服务器打开了哪些端
- netstat -tnl
查看防火墙设置
- iptables -L -n
开放22、80端口
- iptables -A INPUT -p tcp --dport 22 -j ACCEPT
- iptables -A OUTPUT -p tcp --sport 22 -j ACCEPT
- iptables -A INPUT -p tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT
- iptables -A OUTPUT -p tcp --sport 80 -m state --state NEW,ESTABLISHED -j ACCEPT
取消其他端口的访问规则
- iptables -P INPUT DROP
- iptables -P FORWARD DROP
- iptables -P OUTPUT DROP
允许本地回环接口(即允许本机访问本机)
- iptables -A INPUT -s 127.0.0.1 -d 127.0.0.1 -j ACCEPT
允许已建立的或相关连的通行(如数据库链接)
- iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
允许所有本机向外的访问
- iptables -A OUTPUT -j ACCEPT
保存配置:
- service iptables save
转载地址:http://lym6520.iteye.com/blog/1931239。
0 0
- centos iptables设置22、80端口
- CENTOS 6.0 iptables 开放端口80 3306 22端口
- CENTOS 6.0 iptables 开放端口80 3306 22端口
- CENTOS 6 iptables 开放端口80 3306 22等
- Centos技术(3)--CentOS 6.5系统中iptables防火墙开放端口80 3306 22端口
- CentOS中iptables开放80端口
- centos linux防火墙添加80端口iptables
- centos 7 配置iptables开放80端口
- CENTOS IPTABLES 远程只允许22端口
- CENTOS iptables 开放端口
- centos iptables开启端口
- centos iptables 添加端口
- Centos 7防火墙iptables开放指定端口(80)和设置ftp的方法
- CentOS系统中使用iptables设置端口转发
- CentOS系统中使用iptables设置端口转发
- linux iptables 设置仅22、80端口可访问
- centos 6.4 修改ssh默认端口22为其他端口详尽安全教程(包含SELinux,iptables设置)
- CentOS 6.5系统中iptables防火墙开放端口80 3306 22端口
- R-常见操作符
- 黑马程序员--继承(重要)
- PHP连接到MSSQL2005/2008数据库的配置与操作 [PHP]
- Android Animation学习笔记
- 算法之旅,直奔<algorithm>之二十 make_heap
- centos iptables设置22、80端口
- Pascal's Triangle
- 数字电视节目的接收,解码,播放,针对TS
- asp.net mvc 2.0详细笔记__01__新建项目
- Makefile--wildcard函数
- 删除当前目录n个月前的文件
- CSS完美兼容IE6/IE7/IE8/IE9/FF 通用方法 CSS对浏览器的兼容性具有很高的要求
- C# datagridview toolTip悬浮框显示详细内容
- 二叉树非递归遍历