Intermediate · 12 min · practise every command in the built-in terminal

🎯 Mission Briefing: Locked Out of the Server

Your laptop was restored from a backup this morning. Now you need to check which version is deployed on the web server web01 — but SSH refuses to let you in, even though your key is right there. Something about the restore went wrong.

Your objective

Read SSH's complaints carefully, fix what it objects to, and log in to web01 with your key.

Investigation toolkit

ssh deploy@web01                     # Try to connect — read the error!
cat ~/RESTORE-NOTES.txt              # What was done during the restore?
ls -la ~/.ssh                        # Who may read and write your SSH files?
cat ~/.ssh/config                    # How is web01 configured?

Fix and verify

chmod 600 ~/.ssh/config              # Only you may write the config
chmod 600 ~/.ssh/id_ed25519          # Only you may read the private key
chmod 700 ~/.ssh                     # The folder itself: yours alone
ssh deploy@web01 cat /srv/app/VERSION

💡 SSH protects you: a private key that others can read is treated as compromised and ignored. The public key (.pub) may stay readable.

Practice tasks

  1. Try to connect to web01 as deploy
  2. Fix the permissions of your SSH config file
  3. Make your private key readable only by you
  4. Lock down the ~/.ssh folder itself
  5. Log in and read the version deployed on web01

Missions