Hands-on guide series
SSH Mastery: A Hands-On Guide
A six-part, hands-on guide to SSH on a single VPS: key authentication over passwords, the config file with jump hosts and multiplexing, hardening sshd without locking yourself out, local, remote and dynamic port forwarding, agent forwarding and its hijack risk, and file transfer with host-key verification. Every command tested on a live Ubuntu 24.04 server.
What you will build
Security is layers, not a switch. Each part closes a different category of attack, from the automated sweep that finds a brand-new server, to the day one gets in anyway. Read them in order, or jump to what you need.
- 1
SSH Keys vs PasswordsSwitch from password logins to SSH keys on Ubuntu 24.04: generate your first ed25519 key, install it, and prove a key login while a password is refused.8 min - 2
The SSH Config File, Jump Hosts and MultiplexingTurn long commands into short aliases with the SSH config file, reach a private host through a bastion with ProxyJump, and reuse one connection.6 min - 3
Hardening sshd Without Locking Yourself OutPractise sshd hardening safely on a second daemon: disable passwords and root login, cap retries, move the port, and add a fail2ban jail.7 min - 4
SSH Tunnels and Port ForwardingLearn SSH port forwarding on a live server: a local tunnel to a private service, a remote forward, and a dynamic SOCKS proxy for any client.7 min - 5
SSH Agent Forwarding and Its Hijack RiskSee how SSH agent forwarding lets a middle host reuse your keys, why that socket is a hijack risk, and when ProxyJump is the safer choice.6 min - 6
File Transfer and SSH Host KeysMove files with scp, sftp and rsync over SSH, verify SSH host keys against known_hosts by fingerprint, and see where certificate authorities scale.7 min