SSH is one of those key parts of system administration that you will be doing often. But the truth is, there can often be a lot of boilerplate around managing and utilizing your connections. However, the lesser-known SSH config file can be an admin's greatest tool in easing this process.

Though many options can be configured through the config file, Host Aliases is one of my personal favourties. You can specify all sorts of options for your connections in the config, and then use a simple command syntax to skip over the boilerplate. Let's see this in action.

Suppose we want to connect to a server with the user ninja. Additionally, this user requires RSA keys instead of a password logon. We can add the following to our ~/.ssh/config:

Host example
  User ninja
  PreferredAuthentications publickey
  IdentityFile ~/.ssh/id_rsa

Now we can connect using this simple command:

$ ssh example

Pretty neat, eh? The SSH config file is one of your best friends here, and you should definitely take the time to read the man pages a bit. You can specify different keys for different logins, different timeout settings for different connections, and whatever else you think you may need.