~/Blog

Brandon Rozek

Photo of Brandon Rozek

PhD Student @ RPI studying Automated Reasoning in AI and Linux Enthusiast.

SSH Config

Published on

Updated on

Warning: This post has not been modified for over 2 years. For technical posts, make sure that it is still relevant.

Have you ever gone through the hassle of having multiple public/private keys for accessing your remote servers? Before recently, I used to specify the identity file in all my transactions ssh -I ~/.ssh/private_key user@host but no longer! I discovered you can add the following to your ~/.ssh/config to specify which key you want to use!

Host somename 
    Hostname someaddress
    user usernameonserver
    IdentityFile ~/.ssh/private_key

Of course you can add multiple of these entries in that file so that you can ssh without having to worry about explicitly using keys. Just keep in mind that the order of your entries matter.

Reply via Email Buy me a Coffee
Was this useful? Feel free to share: Hacker News Reddit Twitter

Published a response to this? :