Created
June 16, 2016 17:56
-
-
Save geeky-sh/5a3f8beb24ff7525fe4e745e1e9d4714 to your computer and use it in GitHub Desktop.
How to add multiple ssh keys for multiple github accounts on a single machine
This file contains 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 -b 4096 -C "aash.discover@gmail.com" | |
## when prompted for file name, take id_rsa_personal | |
ssh-keygen -t rsa -b 4096 -C "aash@workmail.com" | |
# when prompted for file name, take id_rsa_work | |
## below are the content of ~/.ssh/config | |
Host personalid.github.com | |
Hostname github.com | |
PreferredAuthentications publickey | |
IdentityFile /Users/aash/.ssh/id_rsa_personal | |
Host workid.github.com | |
Hostname github.com | |
PreferredAuthentications publickey | |
IdentityFile /Users/aash/.ssh/id_rsa_work |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment