How To Install sshguard on AlmaLinux 8

In this tutorial we learn how to install sshguard in AlmaLinux 8. sshguard is Protects hosts from brute-force attacks against SSH and other services

Introduction

In this tutorial we learn how to install sshguard on AlmaLinux 8.

What is sshguard

Sshguard protects hosts from brute-force attacks against SSH and other services. It aggregates system logs and blocks repeat offenders using one of several firewall backends. Sshguard can read log messages from standard input or monitor one or more log files. Log messages are parsed, line-by-line, for recognized patterns. If an attack, such as several login failures within a few seconds, is detected, the offending IP is blocked. Offenders are unblocked after a set interval, but can be semi-permanently banned using the blacklist option.

We can use yum or dnf to install sshguard on AlmaLinux 8. In this tutorial we discuss both methods but you only need to choose one of method to install sshguard.

Install sshguard on AlmaLinux 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

After updating yum database, We can install sshguard using dnf by running the following command:

sudo dnf -y install sshguard

Install sshguard on AlmaLinux 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

After updating yum database, We can install sshguard using yum by running the following command:

sudo yum -y install sshguard

How To Uninstall sshguard on AlmaLinux 8

To uninstall only the sshguard package we can use the following command:

sudo dnf remove sshguard

References

Summary

In this tutorial we learn how to install sshguard on AlmaLinux 8 using yum and dnf.