How to Harden SSH and Stop Brute-Force Attacks
On almost every internet-facing server, SSH is the single most-attacked service — automated bots try to guess logins around the clock. The good news: a handful of changes make those attacks completely futile. Here is how to harden SSH properly.
Why SSH is such a target
SSH gives full command-line control of a server, so it is the prize every credential-guessing bot is after. Leave it on the default port with password login enabled and your logs will fill with thousands of attempts a day — you may already have seen too many authentication failures. The fix is not to hide; it is to make guessing impossible.
1. Use SSH keys, not passwords
This is the single biggest win. An SSH key pair replaces a guessable password with a cryptographic key that is effectively impossible to brute-force. Generate a key, install the public half on the server, confirm it works — then move on to disabling passwords entirely.
2. Disable password authentication
Once your key works, turn off password login in the SSH config. From that point, no amount of guessing can get in, because there is no password to guess. This single change ends the entire category of brute-force attacks against you.
3. Disable direct root login
Do not let anyone SSH in as root directly. Log in as a normal user and elevate with sudo when needed. This means an attacker has to know which user to target as well as hold its key — and it keeps a clear audit trail of who did what.
4. Consider changing the port
Moving SSH off port 22 is not real security — a determined attacker will find it — but it does dramatically cut the noise from automated scanners that only check the default port. Treat it as reducing log spam, not as a lock. Keep the real locks (keys, no root) in place regardless.
5. Add brute-force protection
Run fail2ban or similar to automatically ban IPs that rack up failed logins. Combined with key-only auth, this keeps your logs clean and your server off the radar of opportunistic bots.
6. Keep SSH patched
SSH software itself occasionally has serious bugs — the 2024 regreSSHion flaw (CVE-2024-6387) was an unauthenticated remote code execution in OpenSSH, a reminder that even the front door needs patching. Keep your system updated so a known hole is never left open. See more in famous Linux vulnerabilities.
Key-only login plus no root access turns SSH from your biggest liability into a non-event. The bots keep knocking; the door simply has no keyhole for them.
The quick checklist
- Key-based login set up and tested.
- Password authentication disabled.
- Direct root login disabled.
- Port changed to cut scanner noise (optional).
- fail2ban or similar banning repeat offenders.
- System kept patched and up to date.
If you ever lock yourself out while tightening things, the usual culprits are covered in SSH connection refused. This guide is part of the broader Linux VPS hardening checklist.
Shut the front door
Host on infrastructure where SSH and the rest are hardened and patched for you by default.
Keep reading
What Is the AISURU Botnet? The Terabit DDoS Threat Explained
One of the most powerful DDoS botnets of 2025–2026 — what it is, how it works, and why gaming is its #1 target.
5 June 2026 SecurityDDoS Trends of 2025–2026: Bigger, Faster, and Aimed at Gamers
Attacks are bigger, faster and increasingly aimed at gaming. The key DDoS trends and what they mean for you.
20 May 2026 Buyer's guideHow to Choose a Game Server Host (2026 Buyer's Guide)
CPU, Anti-DDoS, location, panel and support — the checklist that actually matters before you buy.
8 May 2026 InfrastructureWhy Frankfurt Is the Best Location for EU Game Servers
Home to the world's biggest internet exchange — why Frankfurt gives EU game servers the lowest ping.
22 April 2026 GuidesBest Minecraft Modpacks to Host in 2026
From All The Mods 10 to RLCraft and Create — the best modpacks to run a server with this year, and the RAM each needs.
11 June 2026 Buyer's guideHow Much Does a Game Server Cost? (2026 Pricing Guide)
What actually drives the price of a game server — RAM, game, location and protection — and what to expect to pay.
9 June 2026 ComparisonFiveM vs RedM: What's the Difference?
What each is, the key differences, and which to choose for your roleplay community.
2 June 2026 SecurityHow to Protect Your Game Server From DDoS Attacks
Why game servers get attacked, what real protection looks like, and what you can (and can't) do yourself.
28 May 2026 GuidesBest Free Minecraft Server Plugins in 2026
EssentialsX, LuckPerms, WorldGuard, CoreProtect and more — the free plugins every Paper/Spigot server should run.
12 June 2026 GuidesBest CS2 Server Plugins in 2026
Metamod:Source, CounterStrikeSharp, MatchZy and more — the plugins that turn a CS2 server into retakes, pugs or practice.
12 June 2026 GuidesBest Rust Server Plugins in 2026 (Oxide / Carbon)
Admin tools, kits, economy, clans, raidable bases — the Oxide/Carbon plugins that build a sticky Rust server.
12 June 2026 GuidesBest FiveM Scripts & Resources in 2026
ESX/QBCore, ox_lib, ox_inventory, pma-voice and more — the resources every FiveM RP server is built on.
12 June 2026 GuidesBest Garry's Mod Server Addons in 2026
ULX, Wiremod, PAC3, DarkRP, TTT and more — the addons and gamemodes that make a Garry's Mod server.
12 June 2026 GuidesBest Valheim Mods to Run on Your Server in 2026
BepInEx, QoL, building and content mods — the best Valheim mods to run on a dedicated server this year.
12 June 2026 GuidesBest ARK Mods to Run on Your Server in 2026
Structures Plus, Spyglass, Cryopods and more — the best ARK mods to run on a server this year.
12 June 2026 GuidesBest Project Zomboid Mods for Your Server in 2026
QoL, vehicles, weapons and overhauls — the best Project Zomboid mods to run on a server this year.
12 June 2026 GuidesBest Palworld Mods & Server Tweaks in 2026
PalDefender, config tuning and QoL mods — the best ways to customise a Palworld dedicated server.
12 June 2026 GuidesThe Best Games to Host a Server For in 2026
Minecraft, Rust, FiveM, CS2, Palworld, Valheim and more — the best games to run a server for this year.
12 June 2026 SecurityWhat Is a DDoS Attack? A Plain-English Guide for Server Owners
No jargon — what a DDoS attack actually is, the main types, why servers get hit and how to stay online.
17 June 2026 SecurityHow ESAGAMES Anti-DDoS Protection Works
A look under the hood of our protection — multi-Tbps Frankfurt filtering and in-house XDP mitigation, always on.
16 June 2026 InfrastructureWhat Is XDP DDoS Filtering? Line-Rate Protection Explained
eBPF/XDP filters packets in the kernel at line rate, before they reach your game. Here is how it stops DDoS.
16 June 2026 SecurityWhat Is an IP Stresser or Booter? (And Why You Should Never Use One)
Booters and stressers are DDoS-for-hire. What they are, how they are abused against gamers, and the legal reality.
15 June 2026 SecurityLayer 4 vs Layer 7 DDoS Attacks Explained
Network-layer floods vs application-layer attacks — the real difference, examples, and how each is stopped.
15 June 2026 SecurityIs My Game Server Being DDoSed? How to Tell
Attack or just lag? The tell-tale signs of a DDoS, how to confirm it, and what to do in the moment.
14 June 2026 InfrastructureInside the ESAGAMES Network: Frankfurt, Peering and Low Ping
Why we build in Frankfurt, how peering at DE-CIX cuts ping, and how the network ties into DDoS filtering.
14 June 2026 GuidesGame Server Lag: Is It Your CPU or Your Network?
Lag comes from two places: CPU tick rate or the network. How to tell which is hurting you, and how to fix it.
13 June 2026 SecurityWhat Is a Botnet? How Everyday Devices Become DDoS Weapons
A botnet is an army of hijacked devices used to launch attacks. How they are built, controlled, and stopped.
17 June 2026 SecurityWhat Is the Mirai Botnet? The Malware That Rewrote DDoS
The IoT malware that launched record DDoS attacks and inspired today's botnets. What it is and why it still matters.
17 June 2026 SecurityDDoS Attack Vectors Explained: UDP, SYN, Amplification and More
A detailed tour of the main DDoS techniques — UDP, SYN, amplification, fragmentation, Layer-7 — and how each is stopped.
17 June 2026 SecurityHow to Protect a TeamSpeak or Voice Server From DDoS
Voice servers are easy targets and very sensitive to lag. Why TeamSpeak gets hit and how to actually protect it.
17 June 2026 ReferenceAnti-DDoS Glossary: Key Terms Every Server Owner Should Know
Plain-English definitions of the DDoS and Anti-DDoS terms you will actually run into — from botnet to XDP.
17 June 2026 GuidesGame Server Security Checklist (Beyond Anti-DDoS)
DDoS is one threat among many. A practical hardening checklist for passwords, admin access, backups and more.
17 June 2026 SecurityThe Biggest DDoS Attacks in History: Records That Broke the Internet
From the Mirai attack that took down Twitter to record multi-terabit floods — the attacks that broke the internet.
17 June 2026 SecurityWhy Do People DDoS Game Servers? The Motives Behind the Attacks
Rivalry, revenge, extortion, boredom — the real reasons people attack game servers, and what it means for you.
17 June 2026 GuidesWhat Is Tick Rate? Why 64 vs 128 Tick Matters
Tick rate is how often a server updates the world per second. What it means, and why 64 vs 128 tick matters.
17 June 2026 GuidesWhat Is Netcode? Why Your Shots Don't Always Register
Netcode keeps online players in sync. What it is, why hit-reg feels off, and how lag compensation works.
17 June 2026 GuidesWhat Is Ping, and How Do You Lower It?
Ping is the delay between you and the server. What causes high ping, and practical ways to lower it.
17 June 2026 ComparisonDedicated vs Shared Game Server Hosting: What's the Difference?
Shared, VPS or dedicated? What each means, the real trade-offs, and which is right for your community.
17 June 2026 SecurityWhat to Do If Someone Gets Root Access to Your VPS
Suspect a root compromise? A calm, step-by-step guide to contain it, investigate, recover cleanly and prevent a repeat.
17 June 2026 GuidesHow to Secure a Linux VPS: A Hardening Checklist
SSH keys, firewall, updates, brute-force protection, least privilege — the essentials to harden a Linux VPS on day one.
17 June 2026 SecurityFamous Linux Vulnerabilities Every Server Owner Should Know
Heartbleed, Shellshock, Dirty Pipe, PwnKit, regreSSHion — the famous Linux bugs, what they did, and the lessons.
17 June 2026 SecurityThe XZ Backdoor: How the Internet Almost Got Backdoored
A hidden backdoor in a core Linux library, planted by a trusted maintainer over years and caught by luck. The story.
17 June 2026 InfrastructureWhat's Changing in Linux & OS Security (And Why It Matters)
Rust in the kernel, Wayland, the memory-safety push, io_uring caution, the CentOS shift — the changes reshaping OS security.
17 June 2026