Web Hosting & VPS Tips

Unleash Your Server Potential with Expert Insights

Hosting provided by: Cloudways
Free to Try! Up to 40% Off!

Category: VPS Setup

Secure FTP with Fail2ban on Ubuntu—install with
apt install fail2ban -y
then set up vsftpd via
apt install vsftpd
Create /etc/fail2ban/jail d/vsftpd conf with
nano /etc/fail2ban/jail.d/vsftpd.conf
adding:
[vsftpd]\nenabled = true\nport = 21\nfilter = vsftpd\nlogpath = /var/log/vsftpd.log\nmaxretry = 3\nbantime = 7200
Enable vsftpd logging in /etc/vsftpd conf with log_ftp_protocol=YES restart both with
systemctl restart vsftpd && systemctl restart fail2ban
Open port with
ufw allow 21
On Linode this bans IPs for 2 hours (7200s)—check with
fail2ban-client status vsftpd
to ensure FTP uptime and security

Back to All Tips