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

Related posts

Sammy Fung

Sammy 是 Linux 技術顧問,擁有 20 年 Linux 技術經驗。