← Back to all lessons

04 / Systems / 25 min READ + PRACTICE

SSH and remote administration.

Learn key-based access, host verification and secure automation on machines you manage.

Practice boundaryUse your own devices, your isolated practice VM or 127.0.0.1. Get explicit authorization for any other system.

Verify the host

SSH encrypts a session and authenticates the remote host as well as the user. Validate a host fingerprint using a trusted channel when first connecting; do not blindly ignore a changed host key. For labs, use a second VM that you own.

Prefer key-based access

Generate a dedicated SSH key pair for your lab, protect the private key, and place only the public key on your test server. Grant the test account just the permissions required for the exercise.

Automate cautiously

Use timeouts, explicit host names and redacted logs in Python SSH automation. Avoid accepting unknown host keys automatically. A successful connection is only the first check; validate the command output and close the session.

HANDS-ON EXERCISE

Try it in your lab

Document the difference between a public key, private key and remote host key, using a fictional two-VM setup.

CHECKPOINT

Make sure it clicks

What should you do if a known SSH host key unexpectedly changes?

TRY WITH OPENCODE

A prompt you can adapt

Review my lab SSH connection script for host-key verification, key handling, timeout and cleanup.
How to set up OpenCode ↗
Your progress stays in this browser only.