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
- SFTP Connection Error: Error loading directory
- FTP failed to retrieve directory listing
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.
Edit FTP Configuration
nano /etc/pure-ftpd.conf
Hit CNTRL+W to search the file and enter the name passive

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

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?
More from cPanel
How To Install A Cloudflare Origin SSL Certificate In cPanel
Free SSL Certificates from places like cPanel or Let's Encrypt are great. When Let's Encrypt first introduces free SSL Certificates …
Create a SWAP partition on CentOS, RHEL and AlmaLinux without a reboot
SWAP is a memory type that Linux NVMe VPS Servers use to process requests. Memory will be held in SWAP …
Help fixing Error: last request failed: [AUTH] Authentication failed.
The Error: last request failed: [AUTH] Authentication failed error can be caused by a range of things. It could be …