Enable FTP Passive mode in PureFTP in your cPanel server

To enable the passive port range for Pure-FTPd, perform the following via the command line as the root user:

  • Open the /etc/pure-ftpd.conf configuration file in your preferred text editor.
  • Remove the comment (#) from the beginning of the line which contains the PassivePortRange option.
  • Change that line to the following:
    PassivePortRange 49152 65534

  • Save the changes to the configuration file.
  • Run the sudo /usr/local/cpanel/scripts/restartsrv_ftpserver command to restart the server.

These configuration changes may be overwritten by system updates. To make these changes permanent, perform the following additional steps via the command line as the root user:

  • Run the sudo rm -f /var/cpanel/conf/pureftpd/main.cache command to clear the cache.

  • Run the sudo echo "PassivePortRange: 49152 65534" >> /var/cpanel/conf/pureftpd/main command to append the passive ports to the configuration file.

Now if the port number is not opened in your iptables then do the following to enable this passive mode port range enable in your iptables.

sudo iptables -I INPUT -p tcp --dport 49152:65534 -j ACCEPT
sudo service iptables save

This articles also recommended for you to read.

  • 24x7servermanagement

    nice article. thanks

    • Approve.

      Shaharia Azam
      Managing Director/ Preview Holdings Limited
      CEO/ Preview Technologies Limited
      Sr. Executive VP/ Mi-Tek Robotics, LLC

      Phone: +8801717530114
      Tel: +880 2 9138 532 (Office)

    • It’s my pleasure to share my tips.