Plainnotes

A few lines worth having in ~/.ssh/config

2025-08-20 · 2 min readTools

Connecting to the same machines every day means retyping the same flags.

Host jump
    HostName 203.0.113.10
    User ops
    IdentityFile ~/.ssh/id_ed25519

Host db1
    HostName 10.0.3.11
    ProxyJump jump
    ServerAliveInterval 30
    ServerAliveCountMax 3
    LocalForward 5432 127.0.0.1:5432

ProxyJump replaces the old ProxyCommand nc incantation and is transparent when the jump host uses keys. ServerAliveInterval survives NAT timeouts. LocalForward exposes a database locally instead of on a public port.

Host * holds globals such as AddKeysToAgent yes and IdentitiesOnly yes. Pair the latter with IdentityFile: it stops the agent from offering twenty keys one after another and tripping the server's attempt limit.