SSH Brute Force Attack Detection

AuthenticationAttacks Linux Auth Brute Force

What This Means

Detect and respond to SSH brute force attacks by analyzing auth.log patterns. Learn to identify automated password guessing, block attackers, and harden your SSH configuration.

Example Log

Mar  8 14:22:31 webserver sshd[12345]: Failed password for root from 185.220.101.42 port 58321 ssh2
Mar  8 14:22:33 webserver sshd[12346]: Failed password for root from 185.220.101.42 port 58322 ssh2
Mar  8 14:22:35 webserver sshd[12347]: Failed password for admin from 185.220.101.42 port 58323 ssh2
Mar  8 14:22:37 webserver sshd[12348]: Failed password for invalid user test from 185.220.101.42 port 58324 ssh2
Mar  8 14:22:39 webserver sshd[12349]: Failed password for invalid user oracle from 185.220.101.42 port 58325 ssh2

Indicators of Suspicious Activity

How to Investigate

  1. Parse auth.log and group failed password attempts by source IP
  2. Check the IP against threat intelligence and abuse databases (AbuseIPDB, Shodan)
  3. Determine which usernames are being targeted (root, admin, common names)
  4. Check if any attempts succeeded by searching for "Accepted password" from the same IP
  5. Review the attack timeline to understand the attack duration and intensity
  6. Check if the same IP is attacking other services (HTTP, FTP, SMTP)

Recommended Mitigations

Scan This Log Instantly

Paste a suspicious log line below and get an instant AI-powered security assessment.

0 / 2000

Need a Full Investigation?

Scan entire log files, detect attack patterns, reconstruct timelines, and generate a full investigation report.

Run Smart Scan

Related Log Types

Related Attack Patterns

Frequently Asked Questions

How do I detect an SSH brute force attack?
Monitor /var/log/auth.log (Debian/Ubuntu) or /var/log/secure (RHEL/CentOS) for multiple Failed password entries from the same IP. More than 5 failures per minute from one IP is a strong indicator.
What is the best way to stop SSH brute force attacks?
The most effective approach is to disable password authentication entirely and use SSH keys. Combined with fail2ban and firewall rules, this eliminates brute force as a viable attack vector.
How do I configure fail2ban for SSH?
Install fail2ban, then edit /etc/fail2ban/jail.local. Set [sshd] enabled=true, maxretry=3, bantime=86400 (24 hours), findtime=600. Restart fail2ban to activate.