Thursday 12 December 2013

FTP getting hanged

Your FTP session is timing out when passive mode is being turned on and you do a directory listing. In FTP, passive mode is necessary for a client behind a firewall to be able to connect to the server. If you were not behind a firewall (NAT included) then you could use active mode. What's happening is that the firewall on your server (CSF) is blocking the high ports necessary to make passive mode FTP work. To resolve, edit the file /etc/pure-ftpd.conf and uncomment the line "PassivePortRange". Then you have to go to your CSF configuration page and put in a rule to allow traffic on those ports. The default ports are 30000 to 50000, so CSF would need a rule to allow traffic on all ports between 30000 and 50000.

If you're not running a very busy FTP server you can easily get by with a smaller range like 30000 to 31000.

After you make the change in the pure-ftpd.conf file be sure to restart the daemon with /scripts/restartsrv_ftpserver.

Once those changes are made then you should be able to open a passive connection properly to the server and get the data returned back to your connection.

No comments:

Post a Comment