Creating an SSH Config file for server shortcuts

If you SSH into a lot of different servers, you may want to create an SSH Config file so that you can use shortcuts to do the commands.  This post will go over the basic steps of creating an SSH Config File.

Without this file if you wanted to SSH to a server, you needed to type out the full address of the server.  For example:


This can take a long time and would be much easier if you could just enter something like:

ssh dev

So here is how we accomplish this.  First open up your users config file using the following command (we will use nano here)

nano ~/.ssh/config

If you have never used this file before then it could be empty or possible does not even exist.  This is fine.

We are going to add two lines.  The first line is going to define a host shortcut name.  The second line is going to define the hostname destination represented in the shortcut.

Host dev

Here is a screen capture of it:

SSH Config File

Go ahead and exit out of nano and save your changes.  Now you can give the command a try by typing the following at your command prompt:

ssh dev

The shortcut should be handled behind the scenes and you should no longer need to type in that really long server name.

Posted in , , and tagged , , .