Ubuntu – how to change vsftpd default port

ftpvsftpd

so here's the deal. I have vsftpd installed and am looking to change the default port to something other than 21. I've checked /etc/vsftpd.conf and can't find a setting to change the default port. I'm running Ubuntu 10.04, which doesn't have the /etc/vsftp/vsftpd.conf file. The only line I'm getting in the file that has to do with ports is the following:

connect_from_port_20=YES

Does anyone know if there's another config file somewhere that I can change the default port on or simply the syntax for a need line to change the port?

Best Answer

According to online manpage (man 5 vsftpd.conf), you can use listen_port option to set port on which vsftpd will listen for control connections. For example,

listen_port=2121

Also note what the default /etc/vsftpd.conf recommends in its header:

# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.
Related Question