# 使用 Homebrew, apk, apt, dnf, MacPorts, Nix, pacman, zypper 安装 sshguard

查看 sshguard 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

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

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install sshguard
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install sshguard
```

  证据: 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
```

  证据: 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
```

  证据: 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
```

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

- Nix (92%):

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

  证据: 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
```

  证据: 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
```

  证据: openSUSE Tumbleweed package metadata: sshguard from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst

## 软件包事实

- **软件包键:** brew:sshguard
- **软件包管理器:** Homebrew
- **版本:** 2.5.1
- **来源摘要:** Protect from brute force attacks against SSH
- **主页:** <https://www.sshguard.net/>
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- sshguard (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 2.5.1
## 项目历史与用法

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.

### 项目历史

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.

### 采用历史

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.

### 使用方式

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.

### 为什么软件包爱好者会关心

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.

### 时间线

- 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.

### 来源

- <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


## 安全说明

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

- **Geiger 风险:** orange / 中
- 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
## 其他软件包管理器记录

- 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-4.fc45: normalized package name match | Fedora Rawhide package metadata: sshguard from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Protects hosts from brute-force attacks against SSH and other services | http://www.sshguard.net
- dnf - sshguard-firewalld - 2.5.1-4.fc45: 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/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Configuration for firewalld backend of SSHGuard | http://www.sshguard.net
- dnf - sshguard-iptables - 2.5.1-4.fc45: 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/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Configuration for iptables backend of SSHGuard | http://www.sshguard.net
- dnf - sshguard-nftables - 2.5.1-4.fc45: 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/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-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.5: normalized package name match | openSUSE Tumbleweed package metadata: sshguard from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-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


## Combined YAML source

View the package source record on GitHub. [combined/sshguard.yml](https://github.com/mxcl/pkgdb/blob/main/combined/sshguard.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated configuration and credential file locations
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
