Connections, key management, ~/.ssh/config patterns, tunneling, ProxyJump, file transfer, and the troubleshooting moves you forget
Persistent connection settings per host. Stop typing long ssh commands.
ssh prod connects to the full host with the right key and port.Host prod
HostName 198.51.100.10
User deploy
Port 2222
IdentityFile ~/.ssh/prod_key
*.example.com hosts share the same key.Host *.example.com
User myname
IdentityFile ~/.ssh/example_key
ServerAliveInterval 60
internal via bastion.example.com. ProxyJump is the modern way.Host bastion
HostName bastion.example.com
User jumper
Host internal
HostName 10.0.0.5
User app
ProxyJump bastion
Host *
ControlMaster auto
ControlPath ~/.ssh/cm-%r@%h:%p
ControlPersist 10m
ssh-keygen -R host to remove the old entry.ssh -v output to see which keys are offered. IdentityFile in ~/.ssh/config or -i flag forces a specific key.ServerAliveInterval 60 in your config so ssh sends keepalives. Combine with ServerAliveCountMax 3 to disconnect cleanly after 3 missed.