# Install sshguard with Homebrew, apk, apt, dnf, MacPorts, Nix, pacman, zypper

Protect from brute force attacks against SSH. Version 2.5.1 via Homebrew; verified from local package data.

## Install

```sh
sudo av install brew:sshguard
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install sshguard
```

  Evidence: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install sshguard
```

  Evidence: MacPorts ports tree: net/sshguard/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- apk (92%):

```sh
sudo apk add sshguard
```

  Evidence: Alpine Linux edge package indexes: sshguard from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz

- Debian apt (92%):

```sh
sudo apt install sshguard
```

  Evidence: Debian stable package indexes: sshguard from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- dnf (92%):

```sh
sudo dnf install sshguard
```

  Evidence: Fedora Rawhide package metadata: sshguard from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst

- Nix (92%):

```sh
nix profile install nixpkgs#sshguard
```

  Evidence: nixpkgs package indexes: pkgs/by-name/ss/sshguard/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- pacman (92%):

```sh
sudo pacman -S sshguard
```

  Evidence: Arch Linux sync databases: sshguard from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

- zypper (92%):

```sh
sudo zypper install sshguard
```

  Evidence: openSUSE Tumbleweed package metadata: sshguard from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-primary.xml.zst

## Package facts

- **Package key:** brew:sshguard
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/sshguard>
- **Version:** 2.5.1
- **Source summary:** Protect from brute force attacks against SSH
- **Homepage:** <https://www.sshguard.net/>
- **Repository:** <https://bitbucket.org/sshguard/sshguard>
- **Upstream docs:** <https://bitbucket.org/sshguard/sshguard/raw/master/README.rst>
- **License:** ISC
- **Source archive:** <https://downloads.sourceforge.net/project/sshguard/sshguard/2.5.1/sshguard-2.5.1.tar.gz>
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

- sshguard (cli)
- sshguard (alias)

## Install behavior

- Post-install hook: not defined
- Service: declared
- Caveats: Add the following lines to /etc/pf.conf to block entries in the sshguard table (replace $ext_if with your WAN interface): table <sshguard> persist block in quick on $ext_if proto tcp from <sshguard> to any port 22 label "ssh bruteforce" Then run sudo pfctl -f /etc/pf.conf to reload the rules.
- Bottle: available on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, arm64_ventura, sonoma, ventura, x86_64_linux

## Freshness

- Page generated: 2026-07-08
- Package-manager version: 2.5.1
- Local data: ok
- Upstream repository: https://www.sshguard.net/
- info: No package-manager update timestamp was available.
- info: Release/tag comparison is only available for GitHub repositories.
## Project history and usage

SSHGuard is a small intrusion-prevention utility that watches system logs for brute-force attacks and blocks repeat offenders through a firewall backend. It became package-manager material because it gives Unix administrators a lightweight alternative to heavier log-monitoring stacks.

### Project history

The official manual and README describe SSHGuard as a tool that aggregates logs and blocks attackers using backends such as pf, ipfw, firewalld, iptables, ipset, nftables, IPFILTER, and hosts.allow. The manual copyright dates begin in 2007, and the current manual version is 2.5.1.

### Adoption history

SSHGuard's official site emphasizes portability and small size, describing it as small C and Bourne shell code with support for many log sources and firewall systems. The input package-manager facts show it available across Homebrew, Debian, Ubuntu, Fedora, Arch, Alpine, Nix, MacPorts, and openSUSE ecosystems.

### How it is used

Operators configure `sshguard.conf`, choose a backend, and feed SSHGuard logs through files, syslog-style services, systemd journal, or macOS log streaming. Attackers are blocked after their score exceeds a threshold and can be temporarily blocked, permanently blacklisted, or whitelisted through explicit addresses or a whitelist file.

### Why package nerds care

Package nerds care because SSHGuard is pure Unix plumbing: logs in, firewall commands out, minimal daemon surface. It is a good example of security tooling whose packaging value lies in service files, default config paths, backend selection, and integration with each operating system's logging and firewall conventions.

### Timeline

- 2007: Official sshguard(8) manual copyright period begins.
- 2024: Official website footer and current site generation reflect active project site maintenance.
- 2025: Official manual pages list version 2.5.1 and date January 1, 2025.

### Related projects

- SSHGuard is related to OpenSSH server logs, syslog, systemd journal, pf, ipfw, firewalld, iptables, ipset, nftables, IPFILTER, and other brute-force blocking tools.

### Sources

- <https://bitbucket.org/sshguard/sshguard/raw/master/README.rst>
- <https://bitbucket.org/sshguard/sshguard/raw/master/doc/sshguard-setup.7.rst>
- <https://bitbucket.org/sshguard/sshguard/raw/master/doc/sshguard.8.rst>
- <https://www.sshguard.net/>
- <https://www.sshguard.net/docs/>
- source_facts.package-manager


## Security Notes

broad file, network, media, or database tool signal. formula declares a Homebrew service.

- **Geiger risk:** orange / medium
- broad file, network, media, or database tool signal
- formula declares a Homebrew service


## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: %PREFIX%/etc/sshguard.conf
## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** sshguard
- **Version Scheme:** 1
- **Revision:** 0
- **Head Version:** HEAD
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** head, stable

## Other Package-Manager Records

- Debian apt - sshguard - 2.4.3-1: normalized package name match | Debian stable package indexes: sshguard from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Protects from brute force attacks against ssh | https://sshguard.sourceforge.net
- Nix - sshguard: normalized package name match | nixpkgs package indexes: pkgs/by-name/ss/sshguard/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - sshguard - 2.4.2-1: normalized package name match | Ubuntu 24.04 LTS package indexes: sshguard from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Protects from brute force attacks against ssh | http://sshguard.sourceforge.net
- apk - sshguard - 2.5.1-r0: normalized package name match | Alpine Linux edge package indexes: sshguard from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Protects hosts from brute-force attacks against SSH and other services | https://www.sshguard.net/
- apk - sshguard-doc - 2.5.1-r0: normalized package name match | Alpine Linux edge package indexes: sshguard-doc from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Protects hosts from brute-force attacks against SSH and other services (documentation) | https://www.sshguard.net/
- apk - sshguard-openrc - 2.5.1-r0: normalized package name match | Alpine Linux edge package indexes: sshguard-openrc from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Protects hosts from brute-force attacks against SSH and other services (OpenRC init scripts) | https://www.sshguard.net/
- dnf - sshguard - 2.5.1-3.fc44: normalized package name match | Fedora Rawhide package metadata: sshguard from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst | Protects hosts from brute-force attacks against SSH and other services | http://www.sshguard.net
- dnf - sshguard-firewalld - 2.5.1-3.fc44: normalized package name match | Fedora Rawhide package metadata: sshguard-firewalld from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst | Configuration for firewalld backend of SSHGuard | http://www.sshguard.net
- dnf - sshguard-iptables - 2.5.1-3.fc44: normalized package name match | Fedora Rawhide package metadata: sshguard-iptables from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst | Configuration for iptables backend of SSHGuard | http://www.sshguard.net
- dnf - sshguard-nftables - 2.5.1-3.fc44: normalized package name match | Fedora Rawhide package metadata: sshguard-nftables from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst | Configuration for nftables backend of SSHGuard | http://www.sshguard.net
- pacman - sshguard - 2.5.1-1: normalized package name match | Arch Linux sync databases: sshguard from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Brute force detector for SSH, Exim, VSFTPD and more. Blocks by ip with iptables | https://www.sshguard.net/
- zypper - sshguard - 2.4.3-2.3: normalized package name match | openSUSE Tumbleweed package metadata: sshguard from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-primary.xml.zst | SSH brute force attack protector | https://www.sshguard.net/
- MacPorts - sshguard: normalized package name match | MacPorts ports tree: net/sshguard/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1


## Related links

- [Secret-risk packages](https://www.automicvault.com/pkg/secret-risk-packages/) - Has protected-tool coverage, approval-gate, or non-low Geiger security signals.
- [Terminal utility packages](https://www.automicvault.com/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Networking and protocol packages](https://www.automicvault.com/pkg/networking-protocol-tools/) - Matched network, protocol, or remote-service metadata.
- [Security and crypto packages](https://www.automicvault.com/pkg/security-crypto-tools/) - Matched security, identity, cryptography, password, signing, or certificate metadata.
- [fail2ban](https://www.automicvault.com/pkg/brew/fail2ban/) - Shares av.db curated category or tags: cli, firewall, intrusion-prevention, security.
- [skm](https://www.automicvault.com/pkg/brew/skm/) - Shares av.db curated category or tags: cli, security, ssh.
- [tkey-ssh-agent](https://www.automicvault.com/pkg/brew/tkey-ssh-agent/) - Shares av.db curated category or tags: cli, security, ssh.
- [openssh](https://www.automicvault.com/pkg/brew/openssh/) - Shares av.db curated category or tags: cli, security, ssh.
- [ssh-audit](https://www.automicvault.com/pkg/brew/ssh-audit/) - Shares av.db curated category or tags: cli, security, ssh.
- [ssh-copy-id](https://www.automicvault.com/pkg/brew/ssh-copy-id/) - Shares av.db curated category or tags: cli, security, ssh.
- [ssh-mitm](https://www.automicvault.com/pkg/brew/ssh-mitm/) - Shares av.db curated category or tags: cli, security, ssh.
- [ssh-vault](https://www.automicvault.com/pkg/brew/ssh-vault/) - Shares av.db curated category or tags: cli, security, ssh.

## Combined YAML source

View the package source record on GitHub. [combined/sshguard.yml](https://github.com/automic-vault/db/blob/main/combined/sshguard.yml)


## Sources

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- curated configuration and credential file locations
- curated package history
- package version freshness
- av.db category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
