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 id_big-value.pub; 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.

Abhishek-Ghosh

0saves

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