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

Jac*_*hec 2 linux debian centos 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
Run Code Online (Sandbox Code Playgroud)

我什至尝试了 telnet localhost 21 并且发生了同样的事情。一旦我发出命令“LIST”,我就会超时。我已经尝试了一切,但我无法让它工作=(

请帮忙 !

PS:iptables是关闭的。

Ste*_*ane 5

FTP 使用多个端口。TCP 21 仅用于命令通道。当您进行目录列表时,您正在通过数据通道传输结果。

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

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

227 Entering Passive Mode (130,255,190,71, 4, 128)
Run Code Online (Sandbox Code Playgroud)

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

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