Signal9Signal9 — home
online
back to labs

Hello, Remote: Your First SSH Login

EasyLinux Fundamentals15-20 min
The brief

Time to do what Linux people actually do all day: log into another machine.

Your sandbox runs a second SSH endpoint on port 2222 — treat it as a remote server called 'the labbox'. It accepts key authentication only (as any well-run server should), so you'll do the full real-world setup, end to end:

1. Generate your keypair: ssh-keygen -t ed25519 (accept the default path; empty passphrase is fine in the sandbox)

2. Install your PUBLIC key on the server — its ~/.ssh/authorized_keys file decides who may log in. Here that's: cat ~/.ssh/id_ed25519.pub >> ~/.ssh/authorized_keys (on separate machines you'd use ssh-copy-id instead)

3. Connect: ssh -p 2222 root@localhost — read the host-key fingerprint prompt before you answer yes; that yes gets recorded in ~/.ssh/known_hosts

4. Prove you were really there: from your shell, run a command ON the labbox that leaves a receipt —

ssh -p 2222 root@localhost 'echo $SSH_CONNECTION > /root/proof/landed.txt'

$SSH_CONNECTION only exists inside SSH sessions, so that file is evidence the trip happened.

Everything here is generated inside this disposable sandbox. On real machines: passphrase-protect your key, and the private key NEVER leaves your machine.

What you'll do
  • Generate an ed25519 keypair at the default path with ssh-keygen
  • Install the public key into ~/.ssh/authorized_keys on the labbox
  • SSH in on port 2222, accepting the host key so it's recorded in known_hosts
  • Leave proof of the trip: /root/proof/landed.txt written over SSH, containing $SSH_CONNECTION

Hands-on lab: you work on a real Linux box in your browser, graded on the machine's actual state.