XXX昨天,将DENY放在ACCEPT之前了。

然后,DROP的条目都生效了。

但同时,VSFTP服务的ACTIVE模式连上正常,但PASSIVE不能使用了。

只好再找方案来解决。

就是在/etc/sysconfig/iptables-config文件里加截模块IPTABLES_MODULES="ip_conntrack_ftp"

搞定。

http://balajitheone.blogspot.com/2011/09/opening-iptables-for-vsftpd.html

Opening IPtables for VSFTPD

While working with vsftpd configuring iptables is essential. It can be done as follows:

Here's the document I refer people to so that they can following the FTP protocol:http://slacksite.com/other/ftp.html
  • To do active-mode FTP, you need to allow incoming connections to TCP port 21 and outgoing connections from port 20.
  • To do passive-mode FTP, you need to allow incoming connections to TCP port 21 and incoming connections to a randomly-generated port on the server computer (necessitating using a conntrack module in netfilter)
You don't have anything re: your OUTPUT chain in your post, so I'll include that here, too. If your OUTPUT chain is default-drop then this matters.
Add these rules to your iptables configuration:
iptables -A INPUT -p tcp --dport 21 -j ACCEPT
iptables -A OUTPUT -p tcp --sport 20 -j ACCEPT
To support passive mode FTP, then, you need to load the ip_conntrack_ftp module on boot. Uncomment and modify the IPTABLES_MODULES line in the /etc/sysconfig/iptables-config file to read:
IPTABLES_MODULES="ip_conntrack_ftp"
Save the iptables config and restart iptables.
service iptables save
service iptables restart
To completely rule out VSFTPD as being a problem, stop VSFTPD, verify that it's not listening on port 21 with a "netstat -a" and then run a :
nc -l 21
This will start netcat listening on port 21 and will echo input to your shell. From another host, TELNET to port 21 of your server and verify that you get a TCP connection and that you see output in the shell when you type in the TELNET connection.
Finally, bring VSFTPD back up, verify that it is listening on port 21, and try to connect again. If the connection to netcat worked then your iptables rules are fine. If the connection to VSFTPD doesn't work after netcat does then something is wrong w/ your VSFTPD configuration
References:
http://serverfault.com/questions/38398/allowing-ftp-with-iptables

VSFTP的PASSIVE模式的防火墙设置相关推荐

  1. VSFTP的主动模式和被动模式

    关于VSFTP的主动模式和被动模式 一,首先我们看两个例子如下: 其中192.168.10.7是服务端,172.16.11.11是客户端 被动模式 # netstat -an |grep 172.16 ...

  2. linux防火墙查看被动模式,Centos7搭建vsftpd及被动模式下的防火墙设置

    一.安装vsftpd:yum -y install vsftpd 二. 创建用户名 useradd zhangsan passwd 123456 useradd lisi passwd 123456 ...

  3. 什么是ftp passive模式

    http://wenku.baidu.com/view/cf571f45b307e87101f69672.html ftp有两个端口号进行服务, 控制进程/命令接口21 数据连接20 如果ftp服务器 ...

  4. 信息安全原理与技术第二次实验:防火墙设置

    信息安全原理与技术第二次实验:防火墙设置 前言 一.实验目的 二.实验原理 三.实验环境 四.实验内容 五.思考题 前言 为了帮助同学们完成痛苦的实验课程设计,本作者将其作出的实验结果及代码贴至CSD ...

  5. Linux iptables防火墙设置与NAT服务配置

    Linux iptables防火墙设置与NAT服务配置 - 摘要: linux教程,NAT服务器,iptables防火墙设置与NAT服务配置, 防火墙是指设置在不同网络或网络安全域之间的一系列部件的组 ...

  6. snort inline模式和passive模式区别

    passive mode provides a reactive protection. It can be configured to reset the attacker's connection ...

  7. vsftp 在pasv下的防火墙配置

    什么叫做PASV mode(被动模式传送)?他是如何工作的? FTP的连接一般是有两个连接的,一个是客户程和服务器传输命令的,另一个是数据传送的连接.FTP服务程序一般会支持两种不同的模式,一种是Po ...

  8. linux 防火墙文件路径,linux防火墙设置

    手机评站网今天精心准备的是<linux防火墙设置>,下面是详解! linux如何关闭防火墙 一.Linux下开启/关闭防火墙命令 1) 永久性生效,重启后不会复原 开启: chkconfi ...

  9. 服务器系统防火墙设置在哪里设置方法,服务器怎么设置防火墙设置在哪里

    服务器怎么设置防火墙设置在哪里 内容精选 换一换 证书推送成功后,您还需要在WAF中,勾选HTTPS协议,并选择已推送的证书.该任务指导用户如何在WAF中进行配置.操作指引:添加防护域名:如果您的域名 ...

最新文章

  1. SpringBoot打成jar包cmd中运行时修改配置文件的值
  2. objective-c 通过类名实例化类
  3. 线性求所有逆元的方法
  4. web前端开发技术期末考试_智慧树来我校开展WEB前端开发微专业导学
  5. pattern recognition and machine learning基本思想1:最大似然估计
  6. T^T找数字(搜索+二进制枚举)
  7. python植物大战僵尸脚本_用 Python 实现植物大战僵尸代码!
  8. 新手入门fedora9 如何打开终端
  9. mysql进销存表设计_ERP进销存-用户表 - 数据库设计 - 数据库表结构 - 果创云
  10. 2007左右美国程序员工资大概样子
  11. (纪录片)鸟瞰中国 China from Above
  12. OpenSSL文档阅读笔记-RSA Encryption Decryption Example with OpenSSL in C
  13. OpenGL--摄像机
  14. LEP环境搭建(linux easy profiling)
  15. 做一个可以赚钱的英文网站
  16. 4.1 使用常见的各种字体属性 [原创Excel教程]
  17. 学习HTML5 Canvas这一篇文章就够了
  18. Spring Cloud 灰度发布解决方案
  19. python 12306登录_python爬虫--模拟12306登录
  20. Unity 3D学习之路

热门文章

  1. ugui获取坐标_UGUI源码解析(六)Raycast
  2. python openpyxl创建excel文件-python之openpyxl生成excel文件
  3. ps_基础技术提升topic基础知识调研
  4. 遍历删除List中的元素,会报错? 用iterator.remove() 完美解决
  5. Java并发系列—并发编程挑战
  6. visualstudio学习
  7. gitlab部署、配置更改、备份及恢复
  8. C#关于委托(基础)
  9. C++ typename 的双重含义
  10. Eclipse启动时报错Java was started but returned exit code=13