FTPlogin后超时

由于某些原因,我无法通过FTP访问我的专用服务器上的任何帐户。 它试图显示目录时,它只是超时。

下面是一个来自FileZila的日志…

Status: Resolving address of testdomain.com Status: Connecting to 64.237.58.43:21... Status: Connection established, waiting for welcome message... Response: 220---------- Welcome to Pure-FTPd [TLS] ---------- Response: 220-You are user number 3 of 50 allowed. Response: 220-Local time is now 19:39. 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 testaccount Response: 331 User testaccount OK. Password required Command: PASS ******** Response: 230-User testaccount has group access to: testaccount Response: 230 OK. Current restricted directory is / Command: SYST Response: 215 UNIX Type: L8 Command: FEAT Response: 211-Extensions supported: Response: EPRT Response: IDLE Response: MDTM Response: SIZE Response: REST STREAM Response: MLST type*;size*;sizd*;modify*;UNIX.mode*;UNIX.uid*;UNIX.gid*;unique*; Response: MLSD Response: ESTP Response: PASV Response: EPSV Response: SPSV Response: ESTA Response: AUTH TLS Response: PBSZ Response: PROT Response: 211 End. 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 (64,237,58,43,145,153) Command: MLSD Response: 150 Accepted data connection Response: 226-ASCII Response: 226-Options: -a -l Response: 226 18 matches total Error: Connection timed out Error: Failed to retrieve directory listing 

我已经重新启动FTP服务次,但仍然没有加载。 当我的服务器达到峰值时,我只有这个问题,它仍然只有1.0(4核),4GB RAM的40%。

ftp连接不是最大限度的,因为只有我和我的同事有权访问服务器上的FTP。

FTP是从1971年的协议。它的一团糟。 PASV模式是一个黑客修复,使其在现代化的基础设施工作。 很可能你的PASV设置是closures的。 要担心的是:

  • PASV需要一个端口范围,需要端口转发。 所以FTP在端口21,但你需要select10个左右的端口转发像5110-5120。
  • PASV需要发送服务器的IP地址。 通常使用LAN地址,但取决于您的防火墙设置,它可能需要是WAN地址。

这就是说你最好使用ssh的SFTP procotol来代替(FTP是非常可怕的,因为它是100%未encryption的)。 SSH需要在防火墙上打开端口22,没有别的。 或者像Mollify这样的基于Web的解决scheme,或者像Oliver这样的FTP的Web前端。

你说这通常有效? 当它正常工作时,我们可以得到一个日志输出吗?

该目录中有多less个文件? 任何超过10K的值都会使服务器陷入困境,并在尝试读取整个列表时导致超时。

我的第三个猜测是,也许被动模式通信不能正确穿越防火墙。 除非其他问题得到解答,否则我不会将其设置为主动模式(如果通常有效,更改设置只会添加更多variables)。

目前服务器上的日志是什么样的?

试一试:

  • PASV模式
  • SFTP
  • 一个不同的FTP客户端

我从来没有见过一个系统自己做这件事情,但是从日志和其他评论看来,当防火墙负载很重时,它看起来就像防火墙无法处理第二个TCP套接字(用于数据传输)。

在发生这种情况时还打开了多less个其他并发TCP套接字?

FWIW,我会尝试主动模式,而不是被动 – 这将花费几乎没有任何尝试。

我有一个类似的问题…
尽pipe我明确的“主动”模式设置,我的FTP连接莫名其妙地进入被动模式。
我重新启动了我的电缆调制解调器和路由器并修复它。