Changing the Port Number of vsftpd

Technically security through obscurity, but still useful to get rid of annoying automated processes trying to access your FTP through the default port

By default, vsftpd (Very Secure FTP Daemon) utilizes port 21. To change this port is a fairly quick process.

$ sudo nano /etc/vsftpd.conf

In this file, find listen_port. If you can’t find it, add it in yourself.


Then restart vsftpd. $ sudo service vsftpd restart

Make sure you allow this port to be used through your firewall. If you’re using CSF, add the port to the TCP_IN and TCP_OUT connections.

$ sudo nano /etc/csf/csf.conf
# Allow incoming TCP ports
TCP_IN = "20,21,25,53,80,110,143,443,465,587,993,995,202"

# Allow outgoing TCP ports
TCP_OUT = "20,21,25,53,80,110,113,443,202"

$ sudo csf -r