sshguard(8)
π NAME π
ok so bestie, sshguard β it blocks brute-force attacks by aggregating system logs. that's the whole vibe. π‘οΈβ¨
(this is the sshguard(8) manual page, btw β SSHGuard Manual, iykyk π)
β¨ SYNOPSIS β¨
sshguard [-hv] [-a threshold] [-b threshold:blacklist_file] [-i pidfile]
[-m block_time_multiplier] [-p blocktime] [-s detection_time] [-w
address | whitelist_file] [file ...]
π¦ DESCRIPTION π¦
sshguard protects hosts from brute-force attacks against SSH and other services. no cap, that's its whole job. it aggregates system logs and blocks repeat offenders using one of several firewall backends. π
sshguard can monitor log files and the standard output of running a shell command. log messages are parsed line-by-line for recognized attack patterns. attackers get blocked when enough attack patterns are detected in a configurable time interval. attackers are blocked temporarily, but you can also permanently block them using the blacklist option. so rude, so deserved. π
π¨ bestie listen:sshguardmust be configured before its first run. seesshguard-setup(7).
πΈ OPTIONS πΈ
-athreshold (default 30) β every detected attack bumps an attacker's attack score, usually by 10. block attackers when their attack score exceeds threshold. literally the "you've gone too far" line.-bthreshold:blacklist_file β blacklist an attacker when its attack score exceeds threshold. blacklisted addresses are written to blacklist-file and never unblocked, even after restartingsshguard. permanent. iconic. no takebacks. π«-ipidfile β write the PID ofsshguardto pidfile. pidfile is removed whensshguardexits. tidy queen behavior.-mblock_time_multiplier (default 2) β for repeat attackers, multiply blocktime by block_time_multiplier for each subsequent block. they keep coming back? the blocks keep getting longer. π-pblocktime (default 120) β block first-time attackers for blocktime seconds. subsequent blocks increase in duration by a configurable factor (see the-moption). and sincesshguardunblocks attackers at random intervals, actual block times may be somewhat longer. close enough, we're not doing math at a party. π-sdetection_time (default 1800) β reset an attacker's attack score after detection_time seconds since the last attack. this means attackers who attack every detection_time seconds are never blocked bysshguard. π however, an increased detection_time may have an impact on legitimate users. so pls be careful with that one.[-waddress | whitelist_file]β whitelist a single address, hostname, or address block given as address. this option can be given multiple times. alternatively, provide an absolute path to a whitelist_file containing addresses to whitelist. seeWHITELISTING. π«Ά-hβ print usage information and exit.-vβ print version information and exit.
π ENVIRONMENT π
SSHGUARD_USERβ when set, sandboxed processes drop permissions by changing to this user. normally set and overridden insshguard.confusing theSSHGUARD_USERvariable.SSHGUARD_DEBUGβ set to enable verbose output fromsshg-blocker. the "tell me everything" button. πSSHGUARD_STATS_DIRβ when set, write Prometheus-compatible statistics to.promfiles in this directory every minute. theSTATS_DIRvariable insshguard.confwill set and override this environment variable.
π FILES π
%PREFIX%/etc/sshguard.confβ see sample configuration file.
β WHITELISTING β
whitelisted addresses are never blocked. periodt. π addresses can be specified on the command line or be stored in a file.
on the command line, give the -w option one or more times with an IP address, CIDR address block, or hostname as an argument. hostnames are resolved once at startup. if a hostname resolves to multiple addresses, all of them are whitelisted. for example:
sshguard -w 192.168.1.10 -w 192.168.0.0/24 -w friend.example.com
-w 2001:0db8:85a3:0000:0000:8a2e:0370:7334
-w 2002:836b:4179::836b:0000/126
if the argument to -w begins with a forward slash ('/') or dot ('.'), the argument is treated as the path to a whitelist file. sneaky but correct.
the whitelist file contains comments (lines beginning with '#'), addresses, address blocks, or hostnames, one per line. π
π§ SEE ALSO π§
π and that's the whole page, bestie! this was SSHGuard Manual, version 2.6.0, dated May 10, 2026 β go forth and block those brutes, you absolute main character. π
π¦ where this page comes from
- arch rolling: sshguard 2.6.0-1 Β· GPL
- Copyright (c) 2007,2008,2009,2010 Mij <mij@sshguard.net>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms