UFW rejecting FTP connections to ProFTPd

July 12, 2014 13.3k views


To strenghten security I want to enable UFW (on Ubuntu 14.04 x64 droplet). I have changed my FTP port from 21 to xx (something else). I allowed this port in ufw by commands:
“sudo ufw allow xx/tcp”
“sudo ufw allow xx”

But unfortunately nothing works for FTP connections. Is it so that I have to enable port 21 as well as xx OR should I try enabling PassiveMode in ProFTPd conf file?

Can anyone throw some light on this issue?


2 Answers

I recommend using SFTP instead of FTP as it is more secure. It uses your existing SSH credentials and encrypts the connection unlike FTP.

If you still wish to use FTP, you will need to whitelist port 20 as well and configure your FTP client to use Active mode:

sudo ufw allow 20/tcp
by Pablo Carranza
This article will teach you how to use Filezilla to transfer and manage files securely on your VPS.


For file transfers from my PC, I’m using WinSCP Client. However, I have several sites where users upload their files and I have configured FTP in my site coding so that such uploads can take place over FTP and not through browser. Is this also insecure? If yes, can I configure ProFTPd for SFTP connections? Will those uploads be done through SFTP if configured in coding?

Have another answer? Share your knowledge.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!