Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

For some reasons I cant access any of my accounts on my dedicated server via FTP. It simply times out when it tried to display the directories.

Heres a log from FileZila...

Status: Resolving address of
Status: Connecting to
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

I have restarted the FTP service serveral times but still It doesnt loads. I only have this problem when my server is reaching it peak usage which is still only 1.0 (4 cores), 40% of 4GB ram.

The ftp connections isnt maxed out because only me and my colleague have access to FTP on the server.

share|improve this question
Have you tried using LIST instead of MLSD? Kind of a shot in the dark... – TonyUser Jul 18 '10 at 14:46

FTP is a protocol from 1971. Its a mess. PASV mode was a hackey fix to make it work in modern infrastructures. Most likely your PASV settings are off. Things to worry about:

  • PASV requires a port range that needs its ports forwarded. So FTP is on port 21, but you need to pick 10 or so ports for forwarding like 5110-5120.
  • PASV requires the IP address of the server sent. Typically the LAN address is used, but depending on your firewall setup it might need to be the WAN address.

That said you'd be better off just using ssh's SFTP procotol instead(FTP is scary as its 100% unencrypted). ssh requires port 22 open on the firewall and nothing else. Or a web based solution like Mollify or a web front end for FTP like Oliver.

share|improve this answer

You state that this usually works? Can we get a log output of what it looks like when it is functioning correctly?

How many files are in that directory? Anything over like 10k will bog down the server, and cause timeouts when trying to read the whole list.

My third guess is that maybe passive mode communications aren't traversing your firewalls correctly. I wouldn't set it to active mode until the other questions are answered (if it usually works, changing settings just adds more variables).

share|improve this answer
You'll have to wait another 4 hours until peak time has ended before I can show you an output when it does function correctly. Theres only around 0.5-1K files if that so I dont think its a problem with that. I dont think its my firewall either, it works during off peak flawlessly. I've even tried which failed to output either during peak times. – Imran Nov 12 '09 at 19:33
I had a similar issue, which I recall related to using PASV mode - but I don't recall the details - I mention it to validate your third point. – Brent Nov 12 '09 at 21:04
Nope I've tried passive mode too, that aint working either – Imran Nov 19 '09 at 3:05

What do the logs look like on the server at this time?

Things to try:

  • PASV mode
  • SFTP
  • a different FTP client
share|improve this answer

I've never seen a system do this myself, but from the log and your other comments it simply looks like your firewall can't handle the second TCP socket used (for data transfer) when it's heavily loaded.

How many other concurrent TCP sockets are open when this happens?

FWIW, I'd try active mode instead of passive - it'll cost almost nothing to try it.

share|improve this answer
How can I check how many concurrent TCP sockets are open? =S – Imran Nov 19 '09 at 3:06
If it's Unix (which your use of Pure-FTP suggests is the case) then you can check the server itself with netstat -an. – Alnitak Nov 19 '09 at 6:42

I had a similar issue...
Where my FTP connection inexplicably went into passive mode despite my explicit "active" mode setting.
I restarted my cable modem and router and fixed it.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.