Pureftp On Multiple Ports

Similar to mail server on some occasions there may arise a necessity to run ftp server (running pureftp) to run on multiple ports. Say for example if you want to run your ftp server on both the standard and customized ports (ie…port 21 and 31) you can follow the instructions below to make it work. It also works well on servers running cpanel / plesk / directadmin .

Multiple Ports on Pure-ftpd

By default when you start pure-ftp, it will be listening on default port 21 on all IPs. If you want to run run pure-ftp on port 31 on IP example).

SSH your server as root :

# cp -p /etc/pure-ftpd.conf /etc/pure-ftpd-31.conf
# vi /etc/pure-ftpd-31.conf

Find and replace the lines

# Bind,21

Now we need to copy the start-up script and run with the new config as a separate service.

# cp -p /etc/rc.d/init.d/pure-ftpd /etc/rc.d/init.d/pure-ftpd-31

Edit the /etc/rc.d/init.d/pure-ftpd-31 to load with the new config.

# vi /etc/rc.d/init.d/pure-ftpd-31

Find and replace the lines

$DAEMONIZE $fullpath /etc/pure-ftpd.conf -O clf:/var/log/xferlog $OPTIONS –daemonize
$DAEMONIZE $fullpath /etc/pure-ftpd-31.conf -O clf:/var/log/xferlog $OPTIONS –daemonize

Now start the new service.

# /etc/init.d/pure-ftpd-31 start

Make sure it starts listening on the new port

# lsof -i tcp:31
# netsat -lpn | grep 31
# fuser -n tcp 31

Note : After doing the changes make sure you have added the new ports in the firewall to allow traffic on the new port.


Privacy Preferences
When you visit our website, it may store information through your browser from specific services, usually in form of cookies. Here you can change your privacy preferences. Please note that blocking some types of cookies may impact your experience on our website and the services we offer.