Changing FTP Passive ports

Vs Nu

Well-Known Member
Jul 17, 2015
132
8
68
India
cPanel Access Level
Root Administrator
How to change the FTP Passive ports from 49152:65534 to some other values ?

I'm getting some sort of attacks on those Ports so let me know the recommend way
 

kodeslogic

Well-Known Member
Apr 26, 2020
320
121
118
IN
cPanel Access Level
Root Administrator
- Log in to the server as the root user via SSH

- Take a backup of the configuration file
Code:
#cp /etc/pure-ftpd.conf /etc/pure-ftpd.conf-backup
- Open configuration file /etc/pure-ftpd.conf
Code:
#vi /etc/pure-ftpd.conf
- Search PassivePortRange and update the port range you want.
Code:
PassivePortRange 49152 65534
- Restart the service for changes to be effective
Code:
#systemctl restart pure-ftpd.service
 

Vs Nu

Well-Known Member
Jul 17, 2015
132
8
68
India
cPanel Access Level
Root Administrator
- Log in to the server as the root user via SSH

- Take a backup of the configuration file
Code:
#cp /etc/pure-ftpd.conf /etc/pure-ftpd.conf-backup
- Open configuration file /etc/pure-ftpd.conf
Code:
#vi /etc/pure-ftpd.conf
- Search PassivePortRange and update the port range you want.
Code:
PassivePortRange 49152 65534
- Restart the service for changes to be effective
Code:
#systemctl restart pure-ftpd.service
I had tried it before but whenever we restart the port range was changing to default values
 

kodeslogic

Well-Known Member
Apr 26, 2020
320
121
118
IN
cPanel Access Level
Root Administrator
Try:

Code:
#echo "PassivePortRange: 49152 65534" >> /var/cpanel/conf/pureftpd/local
#/usr/local/cpanel/scripts/setupftpserver pure-ftpd --force
NOTE: Replace the port range you want.
 

Vs Nu

Well-Known Member
Jul 17, 2015
132
8
68
India
cPanel Access Level
Root Administrator