[FIX] FTP Connection Error : Error loading directory

A client of ours was having problems in connecting to the FTP server using FileZilla. He complained that FileZilla was stuck at “Filezilla Retrieving Directory Listing” and we tried to fix it on the server.
Follow the simple steps and you can fix the issue.

If you have root/SSH access then carryout the following commands
Initially, you’ll need to figure out that PureFTPd and ProFTP what ports to use for Passive FTP.

For PureFTPd make an edit to /etc/pure-ftpd.conf, uncomment the following line, and set the port range you’ll be using.
# PassivePortRange 30000 35000

For ProFTP, do the same for /etc/proftpd.conf.
# PassivePorts 30000 35000

Then, you’ll need to configure CSF to allow that port range through your firewall.

Edit /etc/csf/csf.conf and add the range as StartingPort:EndingPort, like the following.
# Allow incoming TCP ports
TCP_IN = "20,21,22,25,53,80,110,30000:35000"

Or you can even do it via logging in to the WHM -> Plugins -> ConfigServer Firewall

Finally, you’ll need to restart the services.

service csf restart
service pureftpd restart

service proftpd restart
That’s about it

If you do not have root/ssh access then you need to switch the FTP Transfer mode from Passive to Active.

Are you still facing problems ? comment here and we’ll help you out.