Created
December 18, 2020 23:15
-
-
Save Hefeweizen/cb4954a9b29fdf9842e3e6188efcecee to your computer and use it in GitHub Desktop.
My company uses Github for repo storage. I generally check out work repos to ~/Workspace. Other stuff, like my ~/dotfiles are going to other directories. So, here, I use my company wide id_ed25519 key for ssh access to github if I'm in '*/Workspace'. Otherwise, I use credentials scoped to my personal Github account.
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
Host * | |
PermitLocalCommand yes | |
StrictHostKeyChecking ask | |
Host github.com | |
HostName github.com | |
User git | |
IdentitiesOnly yes | |
Match Host github.com exec "pwd | grep '/Workspace' > /dev/null" | |
IdentityFile ~/.ssh/id_ed25519 | |
Match Host github.com !exec "pwd | grep '/Workspace' > /dev/null" | |
IdentityFile ~/.ssh/gh_hefeweizen |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment