SSH aliases using a config file

By Druss , 24 November, 2012

In Linux, you can simplify some of your SSH commands using an SSH config file. For example, create a file named config in your ~/.ssh directory with something like the following:


Host bar
HostName bar.examplecom
User bar user

Host foo
HostName foo.example.com
User foouser

This will allow you to ssh into the specified hosts using short commands such as ssh foo and ssh bar.

More complex options are listed on the man page.

Tags

Tags Old

All times are UTC. All content licensed under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License.