Skip to content

Instantly share code, notes, and snippets.

@Rfrixy
Created November 13, 2020 06:17
Show Gist options
  • Save Rfrixy/b67280bd2c39fd1cf53618b2be3fabde to your computer and use it in GitHub Desktop.
Save Rfrixy/b67280bd2c39fd1cf53618b2be3fabde to your computer and use it in GitHub Desktop.
SSH config -- forward ssh agent and have multiple identities
# Forward agent
Host *
ForwardAgent yes
AddKeysToAgent yes
IdentityFile ~/.ssh/id_rsa
# Multiple identities you will need to add '-personal' yourself to the repository url when cloning
Host gitlab.com
HostName gitlab.com
User git
IdentityFile ~/.ssh/id_rsa
IdentitiesOnly yes
Host gitlab.com-personal
HostName gitlab.com
User git
IdentityFile ~/.ssh/personal_rsa
IdentitiesOnly yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment