Installation & setup

This package ships with three subpackages that configure the different firewall backends SSHGuard supports. If dnf is configured to also install weak dependencies (the default), it will automatically install the one corresponding to your installed firewall. Otherwise, you have to install one manually:

For firewalld
$ dnf install sshguard-firewalld
For iptables-services
$ dnf install sshguard-iptables
For nftables
$ dnf install sshguard-nftables

or use the example config file /usr/share/doc/sshguard/examples/sshguard.conf.sample.

After installation, SSHGuard can be enabled via systemctl:

$ systemctl enable --now sshguard.service

Please refer to the config files or upstream's setup documentation for details.


Due to older/different software versions in CentOS/RHEL, some functionality of the Fedora packages has been changed:

  • CentOS/RHEL 7 or older: No backend subpackages sshguard-<backend>. User must manually configure /etc/sshguard.conf, an example config file is contained in the package's doc directory.
  • CentOS/RHEL 6 or older: Uses SysV Init instead of systemd. Sshguard logs to /var/log/sshguard.log instead of the system journal.