cPanel – Pure-FTPD – Timeout connecting to ftp using explicit FTP over TLS

Published on Author gryzliLeave a comment

The problem

While trying to connect, to FTP by using Passive Mode + explicit FTP over TLS, I was getting the following timeouts:

And the problem was in the Pure-FTPD itself with its PassivePorts range, which wasn’t set and permitted on Firewall.

 

The FIX

In the current fix I will use the default passive port range: 30 000 to 50 000. You can choose whatever you like (make sure the ports are above 1024).

If you choose different port range, make sure write the right values in iptables rule and pure-ftpd configs.

1. Edit pure-ftpd.conf and uncomment the passive port range section

# vim /etc/pure-ftpd.conf

# /etc/init.d/pure-ftpd restart

 

2. Make the changes in cPanel pure-ftpd template

In order to make sure, that cPanel won’t overwrite your changes during next pure-ftpd.conf regeneration, you must edit it’s pure-ftpd.conf template:

 

# vim /var/cpanel/conf/pureftpd/main

3. Open the port range in Firewall

# iptables -t filter -I INPUT -p tcp –dport 30000:50000 -j ACCEPT

 

You could add this rule in: /etc/sysconfig/iptables in order to make it persistent after server restart.

Leave a Reply

Your email address will not be published. Required fields are marked *

Captcha * Time limit is exhausted. Please reload CAPTCHA.