How to change Pure FTP port on cPanel server

You may need to change the default FTP port 21 to any other port like 1234 for security reasons.

We'll provide a step-by-step tutorial on how to change the pure-ftp port on a cPanel server.

cPanel provides an easy way to update pure-ftp config from this file: /var/cpanel/conf/pureftpd/local

 

  1. Login to SSH as root
  2. Edit the config file with nano or your preferred editor # nano /var/cpanel/conf/pureftpd/local
  3. Add Bind: 1234 to the file (where 1234 is the new port number)
  4. Press CTRL+X then press Y and Enter to exit and save.
  5. restart FTP using this command/usr/local/cpanel/scripts/setupftpserver pure-ftpd --force
  6. Finally, add the new port to the firewall

 

If you use firewalld on CentOS 7, use the following command to open the port 1234:

$ sudo firewall-cmd --permanent --zone=public --add-port=1234/tcp

restart firewalld 

$ sudo firewall-cmd --reload

 

If you use CSF, find the config file and open it with nano or your preferred editor

$ nano /etc/csf/csf.conf

Find TCP_IN line and remove the old port number and replace it with the new port or add the new port at the end of this line like:

TCP_IN = "80,443,465,21,22,587,993,25,53 ... ,1234"

Restart CSF using this command

$ csf -r

 

HostRound LLC is a cPanel certified partner, we'll be more than happy to be your hosting provider. Please check our services from this link: https://www.hostround.com/services

  • ftp, port, cpanel, pureftp
  • 466 Users Found This Useful
Was this answer helpful?

Related Articles

How to reinstall an OS on my server?

If you already have an OS installed on your server and want to change or reinstall it, you can do...

How to set rDNS records for my dedicated server IPs?

You can update rDNS records of your server IPs from Client Area (One Portal) Log in to your...

How to set a rDNS/PTR record for my VPS?

Please open a support ticket and provide the rDNS record that you want to set and the IP address...

How DDoS protection works on a VPS?

Our DDoS mitigation system is powered by AI and is local with reduced latency. It can mitigate...

How many IPs I can add to my VPS?

The max IPv4 allocation for a VPS is 2 IPs. So you can add 1 additional IPv4 to your VPS.