SSH config aliases

Stop typing [email protected] -p 2222 every single time.

SNP 023 #159 Filed ssh cmd

Put your servers in ~/.ssh/config:

shell
Host web
  HostName web.example.com
  User deploy
  Port 2222
  IdentityFile ~/.ssh/id_ed25519_work

Host *
  AddKeysToAgent yes
  ServerAliveInterval 60

Now this is all you need:

shell
ssh web

The alias works with scp, rsync and git too, since they all go through ssh. The Host * block at the end sets defaults for everything.