Skip to main content

Senior Web Engineer. Open web / music. Remote DJ. Tall Dutch guy. #3million

micro.blog/sander

svandragt

mixcloud.com/cloudseer

 

Working with Two SSH keys

If you're working with two SSH keys (work / personal) then the following setup is quite elegant. It assumes all repositories are work related, unless they're hosted under your own user:

Host *
 AddKeysToAgent yes
 UseKeychain yes
 StrictHostKeyChecking no
 User git
 IdentityFile ~/.ssh/id_rsa_corporate

# personal account
Host github.com-MYUSERNAME
  HostName github.com
  User git
  IdentityFile ~/.ssh/id_rsa