I was setting up pure-ftpd on a system that needed FTP access for users. The users were using FileZilla. For firewall on the server (running RHEL5), I was using iptables. Was having a difficult time getting FTP with TLS to connect and when I was able to get it to connect I would get the error: “failed to retrieve directory listing”.
Error: Connection timed out Error: Failed to retrieve directory listing
Here is the fix:
# cat /proc/sys/net/ipv4/ip_local_port_range
Make sure ports used do not fall within that range (used by the system). So pick 10000 to 20000, for example.