Setting up GitHub to use multiple servers with different keys

Sometimes you want to connect to two different repositories with two different accounts.

To do this, you’ll need to create/modify your ~/.ssh/config file with the following stanza.

#Personal Repository on Public GitHub
Host github.com
    HostName github.com
    User [email protected]
    IdentityFile ~/.ssh/id_rsa_GitHub_Personal

You can rename your existing id_rsa file to whatever you want, just as long as you specify which file to use for which service in the IdentityFile field.

I’ve used to to connect to my personal GitHub public repository and my Employer’s internal GitHub repository from the same computer with different keys.  (Because you shouldn’t be sharing keys.)  But I haven’t tried doing this with multiple GitHub accounts on the same server yet.  Maybe I’ll look into that next week.  =)

You might also like

Starting the Process

Confucius said that a journey of a thousand miles begins with a single step. After starting and restarting a few books from my Safari Bookshelf,

Parameters vs. Properties

Parameters and Properties are different in Puppet. A Parameter defines HOW a Resource should be managed, but NOT the value. (i.e.  Use init instead of