How to Change FTP service Port on cPanel server


Today while working come across on the request to change port of the FTP from 21 to some other port that is 921 and I followed the steps below to do so :

Check if your server is using Proftpd and pure-ftpd, To check refer the steps below :

>> Login to your WHM
>> Service Configuration >> FTP Server Selection
>> Here you can see on which radio button is checked.

If you are using pureftpd then follow the steps below :

1. Login to ssh via root

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

# vi /etc/pure-ftpd.conf
======================
Bind <addr> <port>
======================

Example :: #Bind 127.0.0.1,21

Replace it with the below line :

======================
Bind 127.0.0.1,921
======================

NOTE : 127.0.0.1 is a localhost and you must replace it with your certain server ip. You may add the lines for multiple ips under it as below :

=================
Bind 192.168.1.2,921
Bind 192.168.1.3,921
=================

192.168.1.2 are just example, you must enter your own server ips.

In my case the port is 921. Save the file.

3. Restart FTP service and cpanel service.

# /etc/init.d/pure-ftpd restart
# /etc/init.d/cpanel restart
Ensure the port 921 is allowed at your firewall.

If you are using proftpd then follow the steps below :

1. Login to ssh via root

2.Edit /etc/proftpd.conf and change:

Port 21

to

Port 921

3. Save file and restart proftpd and cpanel service.
# /etc/init.d/proftpd restart
# /etc/init.d/cpanel restart

You’re Done.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: