How to install Fail2ban on Debian 10?

Overview

Fail2ban is a tool for enhancing server defense against online threats. Depending on the settings you choose, you can temporarily or permanently ban distant IP addresses. It assists you in protecting your server and data from intruders.

This guide explains how to install Fail2ban on a Linux machine running Debian 10 Buster.

Prerequisites

There are certain prerequisites that need to be met before you begin.

  • A machine running Debian 10

  • A root user having Sudo privileges

  • Internet connection

Get Started

Step 1. Always be sure to update your system before downloading the latest packages. Run the following command to do it:

sudo apt update

Step 2. In Debian 10's default repository, the Fail2ban package is available. Execute the following command as root or a user with sudo rights to install it.

sudo apt install fail2ban -y

Step 3. Fail2ban will automatically launch after completion. Run the following command to confirm its status:

sudo systemctl status fail2ban

Ensure the fail2ban service is shown as active: running.

Conclusion

This guide assisted you in setting up Fail2ban on a Debian 10 server. You should be able to set up some blocking rules for your services at this point. Fail2ban is a helpful tool for safeguarding any type of service that makes use of authentication.

Last updated