Change FTP port

This article helps you to change the FTP port in a cPanel server.

Pure-FTP

1) Edit /etc/pure-ftpd.conf and look for the following line:

Bind addr port

Where addr is a publically routable IP. The default example, 127.0.0.1, will cause the socket to bind locally but then this connection won’t serve externally. port is the new port you wish to put the service on.

2) If necessary, add the new FTP port to your server’s firewall.

3) Edit /etc/chkserv.d/ftpd and change the port, which is the first comma-separated entry to the right of ‘=’ on the line in the file, to match the port you put the service on.

Then restart FTP service as follows:

/etc/init.d/pure-ftpd restart
/etc/init.d/cpanel restart (restarts tailwatchd/chkservd)

ProFTP

Edit /etc/proftpd.conf and change:

Port 21

Then restart FTP service as follows:

/etc/init.d/proftpd start
/etc/init.d/cpanel restart (restarts tailwatchd/chkservd) 

Where addr is a publically routable IP. The default example, 127.0.0.1, will cause the socket to bind locally but then this connection won’t serve externally. port is the new port you wish to put the service on.