tech

SSH Configuration Tips

sshworkflowsecurity

The SSH config file (~/.ssh/config) is one of those things you ignore until you finally write one — then wonder how you lived without it.

Host Aliases

Host myserver
  HostName 192.168.1.100
  User deploy
  Port 2222
  IdentityFile ~/.ssh/myserver_ed25519

Now ssh myserver does all of that automatically.

Jump Hosts

Host internal
  HostName 10.0.1.50
  User admin
  ProxyJump bastion.example.com

No need to ssh into the bastion first. One command, straight through.

Keep Alive

Host *
  ServerAliveInterval 60
  ServerAliveCountMax 3

Prevents dropped connections on long-running tasks. Set it globally so every host benefits.