Managing Multiple SSH Keys Through Command Line

Download PDF

Managing Multiple SSH Keys is becoming more and more important these days due to the PaaS instances and less costly IaaS. Here is how to manage multiple Keys. Plus as most of us needs to use GitHub like repositories, more and more separate identities are becoming a standard need. In this guide we will show the process for Managing Multiple SSH Keys.


Managing Multiple SSH Keys : Preface


We will be use Git as remote (although that part is not needed here) and OS X 10.8.2 with iTerm2 and oh-my-zsh as shell (not bash). Commands will be almost same for Linux. The required setup for iTerm2 on OS X 10.8.2 was written before.

Normally, a single default identity is created for the first time usage and those set appear as id_big-value and; where big-value is rsa or dsa. This pair is used for all identification, which might not be relevant (as you will add more and more profiles) later or you want the things to be organized properly. This is why we are taking the pain to create a config file for Managing Multiple SSH Keys.


Managing Multiple SSH Keys : Method


The steps are almost same for Ubuntu and Debian OS, but specifically this is for full OS X Server administration (read Mac OS X 10.8).


First change directory to .ssh :



This is very nice command, you will get a 1024 bit key pair (public and private keys) with no password prompts and many extra things :



If you want 2048 bits, change from 1024. ssh obtains configuration data from the following sources in the following order : command-line options, user’s configuration file ($HOME/.ssh/config), system-wide configuration file (/etc/ssh/ssh_config ).

As the next steps, you will :


Managing Multiple SSH Keys Through Command Line



And finally add for your needed service / git :



As in case of the screnshot, you can see, we got two options to choose from. So this needs to be done first before login to the service.

Incoming search terms:

linux manage multiple ssh keys
If you have enjoyed this article, please consider subscribing to our newsletter or share this post. As we have changed our whole website to HTTPS URL to protect your privacy, social counts will appear lower than they were on HTTP URL.

Here’s what we’ve got for you which might like :

Also, we have YouTube Videos and Apple iTunes Podcast Channel (the link will open iTunes App on Mac).

Additionally, performing a search on this website can help you.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Google+ or Twitter to join the conversation right now!

If you want to Advertise on our Article or want Business Partnership, you are invited to Contact us.

Contact Us