Managing multiple SSH accounts in Github
Lots of companies are using Github nowadays for hosting their private repositories. If you are like me and you don't like mixing up your public/private personas, you might want to have a couple of Github accounts, one for business and one for your personal matters.
Let's see how to achieve this.
Create your SSH keys
In this case, I’ll be creating two SSH keys, one for loalf
(my public profile)
and another one for humandb
(the corporate one).
Two keys will be created
Modify your SSH config file
Next, you’ll have to edit your SSH config file. You config file should be at
~/.ssh/config
. If it doesn’t exist, just create it.
Clone your repository
If you want to clone one of your repositories as loalf
you now do
Note that instead of using github.com
as the host, we’re using
loalf.github.com
instead.
Set up your username and email address
Change your git username and email address within the project.