Howto: Change the FTP port to a non-standard port?

If you are looking to change the Ftp port on your server from 21 to a non-standard port say 2121, you need tweak the ‘bind’ option in the Ftp configuration file.  On a cPanel server with pure-ftp as a Ftp server, you need to edit the pure-ftpd.conf file

# pico /etc/pure-ftpd.conf

Search for the line:

# Bind 127.0.0.1,21

and add the following line below it

Bind *,2121

where, 2121 is the new port you want the Ftp server to listen to.

Save the Ftp configuration and restart the ftp service.

# service pure-ftpd restart

Using the netstat command you can check if the new port is in ‘LISTEN’ state

# netstat -al | grep 2121

If your server is behind a firewall, you will have to open the new Ftp port in the allowed list. For example, if you have CSF firewall installed on your server, edit the configuration at

# pico /etc/csf/csf.conf

and replace port 21 with 2121 in the TCP_IN. Save the file and restart the csf firewall

# csf -r

This entry was posted on Friday, December 18th, 2009 and is filed under cPanel Management. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

Comments are closed.