ip_conntrack_ftp only works on port 21?

21 views
Skip to first unread message

李扬

unread,
Jul 1, 2014, 5:19:24 AM7/1/14
to sh...@googlegroups.com
VPS上装了个vsftpd,想着21端口容易被骚扰,就改了个端口,但是改了之后从远端ftp没法list,没法put,可以mkdir;改回21端口,就正常了。

然后PPTP建立VPN到VPS上,用ppp的ip,改端口也没问题。

估计是网关上nat模块的问题。然后搜openwork相关资料,都是很老的post,有人说ip_conntrack_ftp only works on port 21,是真的吗?

Shell Xu

unread,
Jul 1, 2014, 10:05:53 PM7/1/14
to shlug
我记得vsftpd支持port模式端口绑定。你把这个端口绑死,然后加入iptables和nat过滤列表,还有不知道什么乱七八糟的一堆东西。
试试看?我不确定管用。不过从原理上推断,这应该就不用nat的ftp模式进行计算了。


--
-- You received this message because you are subscribed to the Google Groups Shanghai Linux User Group group. To post to this group, send email to sh...@googlegroups.com. To unsubscribe from this group, send email to shlug+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/shlug?hl=zh-CN
---
您收到此邮件是因为您订阅了Google网上论坛中的“Shanghai Linux User Group”论坛。
要退订此论坛并停止接收此论坛的电子邮件,请发送电子邮件到shlug+un...@googlegroups.com
要查看更多选项,请访问https://groups.google.com/d/optout



--
彼節者有間,而刀刃者無厚;以無厚入有間,恢恢乎其於游刃必有餘地矣。
blog: http://shell909090.org/blog/

py_zhu

unread,
Jul 2, 2014, 1:21:31 AM7/2/14
to sh...@googlegroups.com

ip_conntrack_ftp是根据21端口确定的。
把ftp模式改成被动的试下。

Shell Xu

unread,
Jul 2, 2014, 2:18:11 AM7/2/14
to shlug
pasv模式需要客户端能够打开端口。。。

Chaos Eternal

unread,
Jul 2, 2014, 6:20:47 AM7/2/14
to sh...@googlegroups.com
先问一下,你是打算flash_fxp?

还是只是想传文件
文件大么?
能用sftp么?

李扬

unread,
Jul 2, 2014, 10:50:36 PM7/2/14
to sh...@googlegroups.com
肯定是被动模式,客户端在家里,通过路由器nat上网的。

关键是看网上有人说ip_conntrack_ftp只对21端口生效,改口就不行了。

在 2014年7月2日星期三UTC+8下午1时21分31秒,xianfeng.zhu写道:

ip_conntrack_ftp是根据21端口确定的。
把ftp模式改成被动的试下。

On Jul 2, 2014 10:05 AM, "Shell Xu" <shell...@gmail.com> wrote:
我记得vsftpd支持port模式端口绑定。你把这个端口绑死,然后加入iptables和nat过滤列表,还有不知道什么乱七八糟的一堆东西。
试试看?我不确定管用。不过从原理上推断,这应该就不用nat的ftp模式进行计算了。
在 2014年7月1日 下午5:19,李扬 <elb...@gmail.com>写道:
VPS上装了个vsftpd,想着21端口容易被骚扰,就改了个端口,但是改了之后从远端ftp没法list,没法put,可以mkdir;改回21端口,就正常了。

然后PPTP建立VPN到VPS上,用ppp的ip,改端口也没问题。

估计是网关上nat模块的问题。然后搜openwork相关资料,都是很老的post,有人说ip_conntrack_ftp only works on port 21,是真的吗?

--
-- You received this message because you are subscribed to the Google Groups Shanghai Linux User Group group. To post to this group, send email to sh...@googlegroups.com. To unsubscribe from this group, send email to shlug+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/shlug?hl=zh-CN
---
您收到此邮件是因为您订阅了Google网上论坛中的“Shanghai Linux User Group”论坛。
要退订此论坛并停止接收此论坛的电子邮件,请发送电子邮件到shlug+unsubscribe@googlegroups.com
要查看更多选项,请访问https://groups.google.com/d/optout



--
彼節者有間,而刀刃者無厚;以無厚入有間,恢恢乎其於游刃必有餘地矣。
blog: http://shell909090.org/blog/

--
-- You received this message because you are subscribed to the Google Groups Shanghai Linux User Group group. To post to this group, send email to sh...@googlegroups.com. To unsubscribe from this group, send email to shlug+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/shlug?hl=zh-CN
---
您收到此邮件是因为您订阅了Google网上论坛中的“Shanghai Linux User Group”论坛。
要退订此论坛并停止接收此论坛的电子邮件,请发送电子邮件到shlug+unsubscribe@googlegroups.com
要查看更多选项,请访问https://groups.google.com/d/optout

李扬

unread,
Jul 2, 2014, 10:51:36 PM7/2/14
to sh...@googlegroups.com
传文件而已,方法多的很,只不过想试试这个。

在 2014年7月2日星期三UTC+8下午6时20分47秒,Soahc Lanrete写道:
> 要退订此论坛并停止接收此论坛的电子邮件,请发送电子邮件到shlug+unsubscribe@googlegroups.com
> 要查看更多选项,请访问https://groups.google.com/d/optout

Shell Xu

unread,
Jul 2, 2014, 11:48:09 PM7/2/14
to shlug
所以让你绑死data端口,也做反向映射啊。这样就不需要ftp模块支持了。


要退订此论坛并停止接收此论坛的电子邮件,请发送电子邮件到shlug+un...@googlegroups.com
要查看更多选项,请访问https://groups.google.com/d/optout

Sherlock

unread,
Jul 3, 2014, 11:15:05 PM7/3/14
to Shanghai Linux User Group
昨天刚解决这个问题,RHEL上没有 ip_contrack_ftp的modules
我是通过设定pasv端口+iptable放行的策略来做的 可以做参考

iptables 配置文件里加入
-A INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT
-A INPUT -p tcp --dport 6000:6100 -j ACCEPT

在vsftpd.conf里面
pasv_min_port=6000
pasv_max_port=6100

sellinux设置好就OK了

==========
      InitX
==========

Shell Xu

unread,
Jul 4, 2014, 1:28:54 AM7/4/14
to shlug
其实不用那么多,一个端口就够了。
Reply all
Reply to author
Forward
0 new messages