Skip to content

Instantly share code, notes, and snippets.

@daevski
Last active March 18, 2020 03:17
Show Gist options
  • Save daevski/546ba54c7563a26ea49a7a845d517f11 to your computer and use it in GitHub Desktop.
Save daevski/546ba54c7563a26ea49a7a845d517f11 to your computer and use it in GitHub Desktop.
An example ssh config file using multiple accounts for the same domain.
# Comments:
# This config file allows for the dynamic selection of ssh keys based on the domain name matching the 'Host' line.
#
# The following examples are the urls configured within git remotes (`git remote -v`)
# Example using domain 'github_personal' : git@github_personal:daevski/Project.git
# Example using domain 'github_work' : git@github_work:Organization/Project.git
Host github_work
HostName github.com
User git
IdentityFile /c/Users/daevski/.ssh/github-work
IdentitiesOnly yes
Host github_personal
HostName github.com
User git
IdentityFile /c/Users/daevski/.ssh/github
IdentitiesOnly yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment