Lion Cipher Lab

Harden your SSH server

Why it matters

An SSH server exposed to a network is one of the most probed doors on the internet. Automated bots hammer port 22 around the clock, trying common usernames and passwords, and the account they most want is root. A default OpenSSH install still accepts passwords, which means every one of those guesses is a real chance to get in. Hardening closes that off: turn passwords into a non-option so brute force has nothing to guess, refuse direct root login so an attacker can never target the most powerful account, and narrow who may connect at all. These are a handful of lines in one config file, and…

What you'll learn

Steps in this lab

  1. What you're hardening, and why it's worth it
  2. Confirm key login works BEFORE you change anything
  3. Keep a second session open — your safety net
  4. Back up sshd_config before you edit it
  5. Disable password authentication
  6. Disable direct root login
  7. Optional: limit who and where can connect
  8. Restart safely, then prove a new login works
  9. What you changed, and the habit underneath it

Open the full interactive lab →