How To Use SSH With Multiple GitHub Accounts

All I wanted is to have two GitHub accounts, and use them both from the same computer, using SSH. Is this too much to ask?

I’ve been using my personal GitHub account for some time, and associated my default SSH keys with that account. When I created a work account on GitHub, I expected I’d be able to associate the same SSH keys with the work account, so I can git pull/push as easily.

This proved to be a problem. GitHub does not allow reusing SSH keys across accounts. Here is the message I got when trying to do that:

I managed to overcome this problem by creating new SSH keys for the work account. Read on for the details.

Continue Reading…