After researching for quite a bit, I found that 1Password satisfied the top three requrements without having to carry around a hardware security key.

edwhad / 1password_ssh_agent_wsl_multiple_github_accts.md

submited by
Style Pass
2024-11-20 16:00:05

After researching for quite a bit, I found that 1Password satisfied the top three requrements without having to carry around a hardware security key.

The most common solution I saw for point four is to edit your SSH config to give different names to the hosts associated with each of the accounts. I'm not a fan of this for a couple reasons:

My approach here is to use git config includes to make additional gitconfig files per 'account-directory' that specify exactly the keys (and account information) I want to use for the repos inside. I do this by overriding the SSH command to include the specific puclic key to use for that account - no ssh-agent retries or host configuration needed!

The only caveat is all repos associated with a GitHub account must live under a common parent directory, and not anywhere else on the filesystem.

The example above only shows two accounts, but technically there shouldn't be a limit to the amount of accounts you can use with this method. Since we're explicitly defining the key for each account (and assuming everything is configured correctly) you don't need to worry about the SSH server six key limit, since we'll be getting it right on the first try

Leave a Comment
Related Posts