• Skip to primary navigation
  • Skip to content
  • Skip to primary sidebar

A cPanel Tech

The Diaries of a Linux Server Administrator

  • Home
  • About
  • Privacy
You are here: Home / Articles / How to Change Default FTP Port on a cPanel Server

Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /home/cptech/public_html/wp-content/themes/genesis/lib/functions/image.php on line 116

How to Change Default FTP Port on a cPanel Server

April 15, 2013 By admin

Change default FTP port for greater security for the server and to its contents, if the server is a shared one. Not only because the default port gives you a connection automatically and if they could guess the password, your content is in risk. So, I would suggesto to change the FTP port to a non standard one.

To Change default FTP port to which the FTP service listens to, we need SSH access.

PureFTP

Login to the server as root, and navigate to /etc

cd /etc
pico pure-ftpd.conf

Search for this line

# IP address/port to listen to (default=all IP and port 21).
# Bind 127.0.0.1,21

and change to the desired value , here, I am going to change it to 21001

# IP address/port to listen to (default=all IP and port 21).
Bind 0.0.0.0,21001

If you want to allow specific IPs, you can enter them in line.

Bind 192.168.1.2,21001
Bind 192.168.1.3,21001

Now restart ftp server

/scripts/restartsrv_ftpserver

You should make sure that traffic through the new port is allowed in firewall to get this operational.

 

ProFTP

If you are using proftpd then follow the steps below to Change default FTP port:

Login to ssh via root

Edit /etc/proftpd.conf and change:

Port 21

to

Port 21001

Now restart ftp server

/scripts/restartsrv_ftpserver

Filed Under: Articles, Linux, Tutorials Tagged With: change ftp port, ftp server, ftp server comparison

Reader Interactions

Primary Sidebar

Copyright 2018 CPanelTech