Using multiple accounts on macOS #23829
-
Hi there! I’m having trouble with the SSH keys while using multiple accounts on macOS the key I add 1st into SSH agent only works, the 2nd one doesn’t work. Thoughts? How can them both working at the same time or how to setup the accounts? Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Hi @abd-ur-rehman, Thank you for being here! Working with multiple accounts and multiple ssh keys can be a tricky thing to set up. Most of the time we recommend against having multiple accounts specifically for this reason, and usually just recommend that users use a single account for both work and personal projects. Still, we know this isn’t a good solution for everyone, so hopefully, we can point you in the right direction for setting this up! To do this you’ll need to create an ssh config file in:
The contents should be similar to this, defining two different SSH hosts that point to GitHub but use different keys. You’ll need to modify the contents to point to your two separate SSH keys in the
This config sets it up so that every time you clone a repository using a standard SSH URL ( I hope this helps! |
Beta Was this translation helpful? Give feedback.
-
Thanks for your reply. I already have found a solution from here |
Beta Was this translation helpful? Give feedback.
-
In My Case this worked
|
Beta Was this translation helpful? Give feedback.
Thanks for your reply. I already have found a solution from here