Lion Cipher Lab

Set up SSH key authentication (and disable password login) on a server you own

Why it matters

Almost every server on the internet is administered remotely -- nobody drives to a data center to type on it. The standard way to reach one and control it is SSH (the Secure Shell): an encrypted connection from your computer to a remote machine's command line. And the single most attacked door on the whole internet is SSH secured only by a password. Automated bots hammer exposed SSH servers around the clock, trying millions of username-and-password guesses, and every reused or weak password is one they eventually get. The fix that professionals reach for first is not a stronger password -- it…

What you'll learn

Steps in this lab

  1. First: get a server you OWN, and understand the one safety rule
  2. Meet SSH, and open a terminal on YOUR computer
  3. Understand what a key pair is, and why keys beat passwords
  4. Generate your key pair with ssh-keygen
  5. Install your PUBLIC key on the server with ssh-copy-id
  6. Log in with your key and PROVE it works before changing anything
  7. Open your rescue session, back up sshd_config, and prepare to harden
  8. Disable password login and root login in sshd_config
  9. Apply the change, then TEST the hardening from a fresh terminal
  10. Protect the private key, make it a habit, and where to go next

Open the full interactive lab →