Skip to content

Instantly share code, notes, and snippets.

View saulbaizman's full-sized avatar

Saul Baizman saulbaizman

View GitHub Profile
@saulbaizman
saulbaizman / multiple github accounts, custom ssh hosts, and git url aliases.md
Last active June 17, 2024 19:00
multiple github accounts, custom ssh hosts, and git url aliases

multiple github accounts + custom ssh hosts + git url aliases

As is often the case, this is written for the search engines, because when I tried to find a solution to this problem, I couldn't find one. (Perhaps that was because I wasn't searching with the right keywords, or perhaps I would have found the solution had I been more persistent.) I also understand that very few people will encounter this "problem" (read: require, or desire, this crazy advanced configuration).

Because services like GitHub and BitBucket require each user account to have unique SSH keys, if you have multiple accounts on those services, it's necessary to generate multiple SSH keys.

First, we'll generate the keys.

$ ssh-keygen -t rsa -f github-user1 # key for user1