Introduction to the ssh config file
From UnixCasts.com (formerly Learning the UNIX command line on OS X)
Hey there!
It’s time for our 5th installment of UNIX command line tips. In the previous newsletter, we talked about the tee
command in Redirecting stdout to terminal and a file using tee, and how it's a convenient way to combine two commands into one. This week we’re going to look at another way to simplify your workflow, but this time shift our focus to ssh
. I hope you enjoy it.
Do you manage a lot of servers with ssh?
If you have a lot of servers that you manage and you can’t remember all of the IP addresses, add a configuration like this to ~/.ssh/config
:
Host macbook
HostName 192.168.1.50
User chip
Substitute the values for Host, HostName and User to suit your specific needs.
Logging in is now as easy as this:
ssh macbook
You can add as many entries as you wish into the config file, so if you manage dozens of servers like myself, this can be a very convenient way to name the servers to suit your needs and make logging in so much easier.
For more UNIX tips, please check out UnixCasts.com.