Posts

Showing posts from June, 2021

How to manage multiple GitHub accounts on a single machine with SSH keys

The need to manage multiple GitHub accounts on the same machine comes up at some point in time for most developers. Every single time I happen to change my Mac or need to Git push with a new work account, I end up surfing for the how to’s of something I have done over half a dozen times. My laziness in not documenting the process and inability to remember the steps makes me spent a decent amount of time getting the bits and pieces from all over the web and then somehow making it work. I’m sure there are many of you who have been there, done that and many more of you who are just waiting for the next time the same thing occurs (myself included!). This endeavor is meant to help us all out. 1. Generating the SSH keys Before generating an SSH key, we can check to see if we have any existing SSH keys:  ls -al ~/.ssh  This will list out all existing public and private key pairs, if any. If  ~/.ssh/id_rsa  is available, we can reuse it, or else we can first generate a key t...