/go/sshtop finds the IP addresses with the most failed SSH password attempts and, in block mode, blocks the persistent offenders. It: No setup is needed. GoAdmio's default cron jobs already run sshtop block every hour. Every admin action in GoAdmio has a matching /go/ command, so anything you can click you can also script.
Quick start
# Show the top SSH brute-force sources (changes nothing)
/go/sshtop
# Show them and block every IP over the limit
/go/sshtop block
Arguments
| Argument | Effect |
|---|---|
| (none) | Report only. Nothing is blocked and no alert is sent. |
block |
Report, then block each qualifying IP and send the alert. Takes the lock. |
underattack |
Takes the lock and reports, but never blocks. |
| Anything else | Treated like no argument: report only. |
Only the first argument is read.
Examples
# See who is attacking SSH right now
/go/sshtop
# Block every source over the limit, as the hourly cron job does
/go/sshtop block
# Review the log of past runs
tail -n 20 /var/log/go/sshtop.log
Output
The command prints one table, sorted by failed attempts, highest first. It is printed in every mode, including block.
| Column | Meaning |
|---|---|
IP |
Source address of the failed logins. |
VISITS |
Number of Failed password lines from that IP in /var/log/secure. |
COUNTRY |
Country of the IP. |
CITY |
City of the IP. May be empty. |
COMPANY |
Owner or network name of the IP. |
Example (addresses are placeholders):
IP VISITS COUNTRY CITY COMPANY
203.0.113.45 1842 NL Amsterdam Example Hosting B.V.
198.51.100.7 377 US Dallas Sample Networks LLC
192.0.2.19 64 DE Frankfurt Demo Cloud GmbH
Alerts
When at least one IP is blocked, the command sends the same message by email and WhatsApp with /go/sendmail and /go/sendwhatsapp.
| Item | Value |
|---|---|
| Subject | Blocking SSH Brute Force Attacks (<N> IPs) |
| Body | A greeting, one line per blocked IP, a closing note, and a "do not reply" notice. |
| Line format | SSH Brute Force Attacks <IP> (<visits> Visits) - Country: <country>, Company: <company>. |
| Sent when | At least one IP was blocked in this run. |
Exit status
| Situation | Result |
|---|---|
| Normal run | Prints the table and exits. |
Another block or underattack run is active |
Prints Instance (<name>) already running. and exits with status 1. |
See the full reference at /go/sshtop and the GoAdmio command index.
GoAdmio is free and open source, with no license fees and no account limits. Read the GoAdmio docs, or see why it is a free cPanel alternative at goadmio.com.
