我正在尝试使用 Filezilla 连接到 FTP 服务器。当我使用宽带时它可以工作,但当我使用大学互联网时它会显示:
Error: Connection timed out
Error: Failed to retrieve directory listing
我尝试了被动和主动模式,但都是徒劳。它连接但无法提供目录列表。
以下是主动模式的完整日志
Status: Resolving address of where2service.com
Status: Connecting to 166.62.2.1:21...
Status: Connection established, waiting for welcome message...
Response: 220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
Response: 220-You are user number 22 of 500 allowed.
Response: 220-Local time is now 05:09. Server port: 21.
Response: 220-This is a private system - No anonymous login
Response: 220 You will be disconnected after 3 minutes of inactivity.
Command: USER where2service
Response: 331 User where2service OK. Password required
Command: PASS ***********
Response: 230 OK. Current restricted directory is /
Status: Server does not support non-ASCII characters.
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: PORT 192,168,126,200,228,90
Response: 200 Port command successful.
Command: MLSD
Response: 150 Accepted data connection
Response: 226-Options: -a -l
Response: 226 18 matches total
Error: Connection timed out
以下是被动模式的日志:
Status: Resolving address of where2service.com
Status: Connecting to 166.62.2.1:21...
Status: Connection established, waiting for welcome message...
Response: 220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
Response: 220-You are user number 20 of 500 allowed.
Response: 220-Local time is now 05:13. Server port: 21.
Response: 220-This is a private system - No anonymous login
Response: 220 You will be disconnected after 3 minutes of inactivity.
Command: USER where2service
Response: 331 User where2service OK. Password required
Command: PASS ***********
Response: 230 OK. Current restricted directory is /
Status: Server does not support non-ASCII characters.
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
Response: 227 Entering Passive Mode (166,62,2,1,174,209)
Command: MLSD
Response: 150 Accepted data connection
Response: 226-Options: -a -l
Response: 226 18 matches total
Error: Connection timed out
Error: Failed to retrieve directory listing
将我的加密更新为“仅使用普通 FTP(不安全)”后工作正常
FTP 连接在“检索目录列表”或“连接已建立,等待欢迎消息”时失败。请按照以下步骤操作,这可能会对您有所帮助。
在主动模式下,您发送:
Command: PORT 192,168,126,200,228,90
这是一个私有IP地址。服务器无法连接到该服务器。所以这对于互联网上的服务器肯定不起作用。如果必须使用主动模式,则需要打开防火墙/路由器以将传入的 FTP 连接转发到您的计算机。在 FileZilla 中,打开设置 (
Connection
→ FTP
→ Active mode
) 并进行相应配置。
在被动模式下,您发送:
Command: PASV
Response: 227 Entering Passive Mode (166,62,2,1,174,209)
这意味着 FTP 服务器要求您连接到该 IP 和端口。如果您有防火墙,则无法连接到它。如果服务器未正确设置和防火墙,它将看不到您的传入连接。
有关更多信息,请参阅 FileZilla wiki 中的网络配置文章。
尝试了以上所有方法,但没有成功。最后选择以管理员身份运行Filezilla...问题解决了。
当我连接到我的托管 ftp 服务器时,出现以下错误。
Status: Connection established, waiting for welcome message...
Status: Initializing TLS...
Status: Verifying certificate...
Status: TLS connection established.
Status: Logged in
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
Response: 227 Entering Passive Mode (138,128,162,194,117,133)
Command: MLSD Error: Connection timed out after 20 seconds of inactivity Error: Failed to retrieve directory listing
这就是解决上述问题的正确路径。我使用 filezilla 作为我的 ftp 客户端应用程序。