FTP Connection Error : Error loading directory. FTP failed to retrieve directory listing

FTP Connection Error : Error loading directory.  FTP failed to retrieve directory listing

A common issue with Filezilla is the fact it just won’t connect to some servers. Mostly we see this on cPanel servers running the default ProFTP client. Older versions of FileZilla before version 3.4 didn’t seem to have this issue so if you have recently updated your FileZilla FTP client and you can’t now connect to your server using FTP you will likely need to make some changes to the FTP configuration file and firewall. Often the error message being given will be similar to;

  • FTP Connection Error
  • FTP Connection Error: Error loading directory
  • FTP failed to retrieve directory listing

Free cPanel VPS License

To resolve the error and gain access by FTP first log in to the server as the root user or a user that has root privileges and, if your using the default FTP client in cPanel open up the configuration file in nano.

 nano /etc/pure-ftpd.conf

Hit CNTRL+W to search the file and enter the name passive

Error loading directory

Next, remove the comment (#) from the line that states “#  PassivePortRange 30000 50000” ensure you just remove the ~ and nothing else.

passive ftp ports

Save and close the file. Next, in your Firewall, you now need to allow this port range. We’re using CSF so from the “config server” menu select “Firewall Configuration” then select “IPv4 Port Settings” and in the ports, box add at the very end “30000:50000”. So your port file should look like this;

,2087,2095,2096,3004,5656,5353,30000:50000

Your ports may be different but the format should still be the same. If you’re using just IPtables you can use the following rule to allow the range

iptables -A INPUT -p tcp --match multiport --dports 30000:50000 -j ACCEPT

Now restart FTP and CSF and try to connect to the server using FTP again.

How was this article?

FTP Connection Error : Error loading directory. FTP failed to retrieve directory listing
20 5 100%
cPanel VPS Server

cPanel Dedicated Servers VPS Servers

Select Language
SSD Reseller Web Hosting ★ Host 50 Domains ★ 50 Free SSL Certificates ★ Weekly Backups ★ Free Migrations In14 Day Free Trial
+