SSH Cheatsheet
Power user.
Overview
SSH fluency turns ad-hoc remote access into reproducible workflows. The patterns below are the small set every operator should have on muscle memory.
- Authenticated, encrypted shell. Public-key auth with end-to-end encryption. Passwords are not in the picture.
- Port forwarding.
-Lfor local forward,-Rfor remote,-Dfor dynamic SOCKS. The three flags cover almost every tunnel use case. - Config file.
~/.ssh/configcaptures per-host settings. The command line stays short and reproducible. - Agent forwarding and multiplexing.
-Aforwards the agent for multi-hop access;ControlMasterreuses connections so repeat sessions skip the handshake.
The approach
Three habits separate a fluent SSH user from a tutorial-driven one: configuration lives in the config file, keys are modern, and multiplexing is on by default.
- Per-host config in
~/.ssh/config. Host, User, Port, IdentityFile. The command becomesssh host, not a 60-character line. - ssh-keygen -t ed25519. Modern algorithm, smaller keys, faster handshakes. RSA 2048 is legacy at this point.
- Local-forward and ProxyJump.
ssh -L 5432:localhost:5432 hosttunnels to internal services;ssh -J jumphost hostchains through a bastion. - ControlMaster auto. Connection multiplexing in the config. Repeat sessions skip the handshake; the operator notices the speed difference within a day.
Why this compounds
SSH fluency is high-leverage because the same patterns serve every remote-access task the operator runs. Each captured config saves seconds per use, compounded across thousands of sessions.
- Faster operations. Configured SSH removes friction from every remote task. The savings compound across the day.
- Stronger security. Key-based auth plus ProxyJump bastion patterns shrink the attack surface compared to direct password access.
- Reusable across the team. Sharing the config (with private bits redacted) gives every new engineer the same defaults.
- Year-one investment, year-two habit. The first config takes an afternoon. After a year, the patterns are reflexive.