Last Updated: February 25, 2016
·
434
· rishav

SSH config Shortcuts

Ssh'ing into servers alot ?

Tired of typing "ssh user@typeditsomanytimesitscrazy.com".

There is a simple trick you can use to save you some time, when you do it as often as i do.

Basically, you can create Hostname shortcuts in your ~/.ssh/config file.For example if your ~/.ssh/config file looks like the one below


Host production Hostname production.example.com User ubuntu IdentityFile ~/secretlocation/example.pem Host staging Hostname staging.example.com User deploy ForwardAgent Yes </code> </pre> You can just $ ssh production </code></pre> or $ ssh staging </code></pre> The line below takes care of SSH forwarding ForwardAgent Yes </code></pre>