Why Is My Server Getting So Many SSH Login Attempts? What It Means and What to Do
You set up a new server, check the logs a day later and find hundreds or thousands of failed login attempts. Usernames you have never created, such as root, admin, test and oracle, are being tried again and again from IP addresses all over the world.
It is one of the most common questions new server owners ask. Has someone targeted me? Am I already compromised? This guide explains what is going on, how much it matters and what you can do about it.
Why is this happening to my server?
The short answer is that it is not personal. Any machine with a public IP address and SSH listening on port 22 will be found by automated scanners, often within minutes of going live.
Attackers run software that sweeps through huge ranges of IP addresses, looking for open SSH ports. When one is found, the bot starts working through lists of common usernames and passwords. Many of these bots run on machines that have themselves been compromised, which is why the attempts come from so many different countries and networks.
It is a numbers game
Most of these bots do not know or care who you are. They try millions of servers because a small fraction will have a weak password, a default account or a forgotten test user. Your server is simply one address on a very long list.
What kinds of attack are you seeing?
Failed SSH logins usually fall into a few familiar patterns:
- Brute force attacks – rapid attempts against one account, cycling through possible passwords.
- Dictionary attacks – working through lists of common or previously leaked passwords rather than random guesses.
- Credential stuffing – reusing username and password pairs stolen from other breaches, in the hope that someone has reused them.
- Username probing – trying common system and application account names to see which exist.
On most Linux systems you will find these attempts in /var/log/auth.log (Debian and Ubuntu) or /var/log/secure (Red Hat-based systems). The journalctl and lastb commands are also useful for a quick look.
How worried should you be?
A failed login is, by definition, an attack that did not work. The volume alone is not a sign that you have been breached. What matters is whether any of those attempts could ever succeed.
If you allow password logins, have a guessable password or leave the root account open to remote login, the steady stream of attempts is a real risk. If you use key-based authentication and have locked down the basics, the attempts are mostly noise. That said, noise still costs CPU time, fills your logs and can hide the one event that genuinely matters.
Practical steps to reduce the risk
You do not need to do everything at once, but each of these steps makes a meaningful difference:
- Use SSH keys and turn off password authentication. This single change defeats almost every brute force and dictionary attack.
- Disable direct root login. Log in as a normal user and escalate privileges when needed.
- Restrict who can log in. Use options such as AllowUsers or AllowGroups so only named accounts can connect.
- Block repeat offenders automatically. Tools such as fail2ban watch your logs and ban IPs after a set number of failures.
- Limit access at the firewall. If only a few known IP addresses need SSH, allow those and block everything else, or put SSH behind a VPN.
- Keep OpenSSH and your operating system updated. Patches close weaknesses that attackers actively look for.
- Keep watching. Review logs regularly so you notice changes in volume or behaviour.
Which measure does what?
| Measure | What it does | Limitation |
|---|---|---|
| Key-only authentication | Makes password guessing pointless | Keys must be managed and protected |
| fail2ban | Bans IPs after repeated failures | Only reacts after attempts have started |
| Firewall allow-list | Hides SSH from almost everyone | Harder if your own IP changes often |
| Changing the SSH port | Cuts down log noise from basic scanners | Not real security; determined scanners find it |
| Shared IP blacklists | Blocks known attackers before they reach you | Lists need regular updating to stay useful |
Going further: learning from the attackers
Blocking attacks on your own server is reactive. Each IP has to fail several times before it is banned, and every new server has to learn the same lessons from scratch.
A more proactive approach is to study attackers in a controlled setting. A honeypot is a deliberately exposed service that exists only to attract and record malicious activity. Because no legitimate user should ever connect to it, every connection is useful intelligence: which IPs are active, which usernames and passwords they try, and where they come from.
That intelligence can then be turned into blacklists and shared across your infrastructure, so attackers seen in one place are blocked everywhere before they get a chance to try their luck.
The same pattern applies to mail servers. SMTP, IMAP and POP3 services see constant authentication attacks and credential stuffing, and they benefit from the same mix of hardening, monitoring and shared blocking.
How AttackRadar helps
AttackRadar is Transcom's attack intelligence platform, built to show you exactly this kind of activity and to act on it. Its live SSH Attack Intelligence demo shows real-time brute force detection, dictionary attack analysis, geographic threat correlation and automated blacklist distribution. At the time of writing it had recorded around 362,000 attacks from 1,821 IP addresses.
Key features include:
- SSH, SMTP, IMAP and POP3 honeypots that capture credential stuffing and brute force attempts.
- Real-time attack maps showing source countries, threat levels and attack vectors.
- IP intelligence with geolocation, reverse DNS analysis and reputation scoring with AbuseIPDB integration.
- Automatic blacklist generation in iptables, fail2ban, Postfix and SpamAssassin formats.
- Managed Threat Response, with automated fail2ban integration and dynamic iptables updates every 15 minutes.
The Starter plan costs £499 per month and covers single server monitoring, SSH and mail honeypots, the real-time attack map, basic analytics, blacklist generation and API access. The Professional plan, at £1,499 per month, covers up to 10 servers and adds all attack vectors, multi-region honeypots and network topology mapping. Enterprise options are also available. There are no contracts, so you can cancel at any time.
See it for yourself
If your logs are full of failed logins and you want to understand who is behind them, and block them automatically, explore the live demos and plans on the AttackRadar homepage.