Last active
January 3, 2018 15:21
-
-
Save shafinmahmud/ef8916c9263bd659f8d3e0d1e8447de3 to your computer and use it in GitHub Desktop.
Configuring Multiple SSH keys for Multiple github accounts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ssh-keygen -t rsa -C "<work-email>" | |
~/.ssh/id_rsa | |
~/.ssh/id_rsa_<work-id> | |
$ ssh-add -D | |
$ ssh-add ~/.ssh/id_rsa | |
$ ssh-add ~/.ssh/id_rsa_<work-id> | |
$ ssh-add -l | |
$ cd ~/.ssh/ | |
$ touch config | |
$ vim config | |
#personal account | |
Host github.com | |
HostName github.com | |
User git | |
IdentityFile ~/.ssh/id_rsa | |
#work account | |
Host github.com-<work-id> | |
HostName github.com | |
User git | |
IdentityFile ~/.ssh/id_rsa_<work-id> | |
git clone [email protected]<work-id>:/github-repo.git |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment