Created
May 14, 2019 08:47
-
-
Save DoumanAsh/b01af6de04b74b7ffbac8ba9b41d14ef to your computer and use it in GitHub Desktop.
ssh config for multiple keys to the same host (e.g. github)
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
# Personal GitHub account | |
Host github.com | |
HostName github.com | |
User git | |
AddKeysToAgent yes | |
IdentityFile ~/.ssh/id_rsa | |
# Work GitHub account | |
Host github.com-work | |
HostName github.com | |
User git | |
AddKeysToAgent yes | |
IdentityFile ~/.ssh/id_rsa_work |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
With this config you can access github using personal ssh key as
github.com
While work key will allow you to access it using
github.com-wok
E.g. pull repo using work ssh key: