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

I'm trying to connect to a CentOS Linux box that I have hosted on EC2 and I think I have everything configured correctly but when I try to connect I get this series of messages

Status: Connection established, waiting for welcome message...
Response: 220 (vsFTPd 2.0.5)
Command: USER tyndall Response: 331 Please specify the password.
Command: PASS *********
Response: 230 Login successful.
Status: Connected
Status: Retrieving directory listing...
Command: PWD
Response: 257 "/home/tyndall"
Command: TYPE I
Response: 200 Switching to Binary mode.
Command: PASV Error: Connection timed out Error: Failed to retrieve directory listing

Not sure where to start troubleshooting this issue. Any ideas? Do I need to change any permissions? I would think this ID has the ability to see my own home directory.

I am able to push/pull files from the command line version of FTP client working on Windows.

share|improve this question
up vote 3 down vote accepted

I solved this exact problem on one of my servers in the past; It was a Filezilla server on Windows Server 2008 also on EC2.

The solution: It was a matter of setting the passive port range on the ftp server & opening that same range in the EC2 Security Groups. You may even need to add the range to IPTables within CentOS if iptables is being used -- although you should consider turning off iptables as it is a bit redundant with EC2 Security Groups.

Have a look here:

You could also configure VSFTPd to use active (not passive) mode - so it uses only port 20/21. The difference between active and passive is explained here:

share|improve this answer
If I'm just using plain old FTP wouldn't I only need port 20 and 21 open? I'm adding this to the question, but I am able to push/pull files from the command line version of FTP client working on Windows. – Tyndall Jan 14 '11 at 5:22
In PASV move the client initiates both connections right? 20 and 21. Am I supposed to be reading the Network Configuration guide? I don't see the solution in the forum post. – Tyndall Jan 14 '11 at 5:30
your problem is extremely common and the solution is just a matter of using the right search terms in google. "CentOS vsftpd failed to retrieve directory listing" should provide sufficient results to resolve your issue. good luck! – iainlbc Jan 14 '11 at 5:30
Thanks for your help. +1. Got me on the right path. This is what fixed it for me. – Tyndall Jan 14 '11 at 5:50
fantastic - happy to help and thanks for linking the solution – iainlbc Jan 14 '11 at 18:27

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.