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:
So here is how we accomplish this. First open up your users config file using the following command (we will use nano here)
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 Hostname my.really.long.dev.address.com
Here is a screen capture of it:
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:
The shortcut should be handled behind the scenes and you should no longer need to type in that really long server name.