-
Notifications
You must be signed in to change notification settings - Fork 698
Description
At work, we are migrating to use GitHub's Enterprise Managed Users (EMU), and our enterprise policy prevents enterprise users from interacting with non-enterprise repos (no PRs, no commenting on issues, etc.). So in order to contribute to OSS, we have to maintain two separate users - an enterprise one and a public one. This causes a problem when using SSH keys to authenticate - GitHub does not allow the same key to be used for multiple users, so each user has to have its own SSH key.
This then brings up the question of how to choose which key to use when connecting to github.com. With Git, it respects ~/.ssh/config
, so the following setup works (just have to remember to use the appropriate host in remotes):
Host github
HostName github.com
User tp-woven
IdentityFile ~/.ssh/id_ed25519
AddKeysToAgent yes
IdentitiesOnly yes
Host github-sg
HostName github.com
User <enterprise_user>
IdentityFile ~/.ssh/id_ed25519_emu
AddKeysToAgent yes
IdentitiesOnly yes
However, trying to use this setup with jj
results in an error:
Error: failed to resolve address for github-sg: nodename nor servname provided, or not known; class=Net (12)
@yuja suggested on Discord that I may be able to use ssh-add -h
, but this does not seem to be supported on macOS.