在Linux上的FTP“无法检索目录列表”不是防火墙问题

我在德国运行Debian X64有一个VPS。 我有很奇怪的问题。

我使用proftpd安装了ISPConfig CP,我无法通过任何方式连接到FTP。

几个小时之前,我已经在CentOS上安装了DirectAdmin,它的VPS和相同的问题。

只要当我连接到FTP服务器,我得到这些:

Status: Resolving address of web02.defikon.com Status: Connecting to 130.255.190.71:21... Status: Connection established, waiting for welcome message... Response: 220---------- Welcome to Pure-FTPd [privsep] [TLS] ---------- Response: 220-You are user number 1 of 50 allowed. Response: 220-Local time is now 12:15. Server port: 21. Response: 220-This is a private system - No anonymous login Response: 220-IPv6 connections are also welcome on this server. Response: 220 You will be disconnected after 15 minutes of inactivity. Command: USER default1 Response: 331 User default1 OK. Password required Command: PASS ****** Response: 230-User default1 has group access to: client0 sshusers Response: 230 OK. Current restricted directory is / Command: OPTS UTF8 ON Response: 200 OK, UTF-8 enabled Status: Connected Status: Retrieving directory listing... Command: PWD Response: 257 "/" is your current location Command: TYPE I Response: 200 TYPE is now 8-bit binary Command: PASV Error: Connection timed out Error: Failed to retrieve directory listing 

我甚至尝试了telnet localhost 21和相同的事件。 一旦我发出命令“LIST”,我就会抽出时间。 我试过每一件事,我无法得到这个工作=(

请帮忙 !

PS:iptables已closures。

FTP使用多个单一的端口。 TCP 21仅用于命令通道。 当你做目录列表,你通过数据通道传输结果。

由于您使用的是被动模式,因此服务器将为数据通道打开一个随机的高端口(> 1024),并且客户端必须打开另一个到该端口的TCP连接。

通常,在PASV命令之后,服务器应该回答

 227 Entering Passive Mode (130,255,190,71, 4, 128) 

这将告诉你的客户端服务器130.255.190.71正在监听端口(4 * 256 + 128)= 1152

因此: – 尝试获取原始消息,包括来自服务器的答复(对PASV命令的响应) – 再次检查防火墙规则

如果你和你的ftp服务器都在防火墙后面,FTP将不起作用。 它可以使工作,但它是脆弱的,涉及活的鸽子和巫毒粉。

你可能会看到,如果你可以使用SFTP,这将使用encryption连接进行连接,并与双重防火墙(我用我的系统使用它)工作得很好。

如果你能进入机器,那么你可以使用rsync,sftp和scp来回移动文件,甚至是完整的子目录树。 SFTP是非常多的FTP,只是通过SSH / SSL链接。

我意识到你正在使用VPN,但是encryption永远不会受到伤害,并且FTP以一目了然的方式广播所有内容。 (我认为stunnel可以帮到那里,但仍然… … ftp是旧的,并不能很好地与防火墙。)

问题昨天解决了。 FTP问题是由SolusVM错误引起的。 问题已修复,FTP现在工作正常。

感谢所有的答复。