Photo of David Winter

david winter

Setting up SSH host shortnames

Here’s an example setup to create SSH host shortnames. On you local computer, add the following to ~/.ssh/config:

Host server1
User david

Host server2
User david

Host *
User davidwinter

Now with this file saved, you can ssh into with just the following command:

ssh server2

This will save you having to type out:


And if you have public key authentication setup, it makes the process even smoother. Adding the wildcard host record at the bottom allows you to specify a default username to use for other servers to the ones you’ve not specified above.