Linux Harbour

Technology News of Linux & Open Source

Linux

Install Fail2ban on Ubuntu

On internet, sometimes some unknown bots / hackers are trying to login any email / FTP servers available on Internet. Some failure login attempts are found on related log files. We can install and use fail2ban to scan these log files and block some IP addresses for a while.

Install fail2ban on Ubuntu

$ apt-get install fail2ban

To block Fail auth for PureFTPD, Dovecot and Postfix, we edit the following files and following lines instead of howto manual.

$ vim /etc/fail2ban/jail.d/defaults-debian.conf

[pure-ftpd]
enabled = true

[dovecot]
enabled = true

[postfix]
enabled = true

$ /etc/init.d/fail2ban restart

Sammy Fung

Sammy is the founder of the Linux Harbour.