Pure-ftpd-mysql change port for ftp connection

Hello All

I have been scratching my head since last month on solving a problem. I wanted to change the default port 21 for the ftp connection to a different port of my web server with cyberpanel. I couldn’t find a proper article finally I found a solution and I wanted to share it with you:

  1. Pure-ftpd conf files are located in this location: /etc/pure-ftpd/conf/
  2. Please make sure the path is correct for your server before proceeding further. You will find several other files in the folder, namely: ChrootEveryone, ForcePassiveIP, MySQLConfigFile, etc.
  3. Type echo “,1234” > /etc/pure-ftpd/conf/Bind. This will create another file named as Bind in the conf directory. Basically, you are allowing all IP addresses to for ftp connection on port 1234 now. if you want to specify certain IP range, you can add the ip range in the format before the port like this: “,1234”
  4. Next, restart your pure-ftpd-mysql using this command: service pure-ftpd-mysql restart
  5. Finally, you can make sure that the port has been changed by running this command: netstat -tnulp | grep pure-ftpd

It should display something like this:

tcp 0 0* LISTEN 253857/pure-ftpd (S
tcp6 0 0 :::1234 :::* LISTEN 253857/pure-ftpd (S

Finally, you have to go to your cyberpanel> Security > Firewall and if the status is on, please add a rule to allow tcp connection from the newly added port

Now you can test your connection using WinSCP or any other ftp client.