Setting an FTP Server Access on EC2 - Filezilla Client Stucks, WinSCP Rules?

After spending long painful hours circumventing group security AND windows 2008 server Firewall, and setting up FIlezilla Server on an amazon EC2 instance with the correct settings (feeew !), I was finally able to connect to my FTP Server remotely. However, Filezilla kept taunting me by spitting a "Failed to retrieve directory listing" error.

After a couple of hours twisting each and every possible parameter on both server and client sides ( I tried every possible Active/Passive combination) I finally threw the towel and decided to put my last hopes on some alternative FTP client and pray. I Downloaded WinSPC and... Voilà !

I am finally a happy man after a spoiled sleepless night, but I am still frustrated because I still have no Idea of what got wrong.

Any suggestions are welcome.


Solution 1:

You have to change the FTP mode on your FileZilla client to active.

If you're connecting using FileZilla Client, make sure you are connecting using Active Connection (default is passive).

  • Edit | Settings | Connection
  • FTP: choose Active
  • FTP | Active Mode: choose "Ask your operating system for the external IP address"
  • FTP | Passive Mode: choose "Fall Back to Active Mode"

Solution 2:

You cannot get passive mode working because the FTP server is giving the client its internal IP address (EC2 instances are behind a NAT). Hence the client timeout while trying to connect to the (unroutable...) private address.

If you want to solve the problem server side (thus be able to use passive mode also, not only active mode), should be enough to set the server to actively retrieve his external IP address.

Using passive mode can be useful if the client is behind a NAT router not smart enough to understand that an FTP session is starting and an incoming connection to a negotiated PORT has to be accepted.

Useful resource.