Managing multiple SSH identities
13 Feb 2017Sometimes, it makes sense to have multiple SSH identites. This can certainly be the case if you’re doing work with your own personal accounts, vs. doing work for your job. You’re not going to want to use your work account for your personal stuff.
In today’s post, I’m going to run through the few steps that you need to take in order to manage multiple SSH identities.
Different identities
First up, we generate two different identities:
When asked, make sure you give the file a unique name:
Now, we create the identity for home.
Again, set the file name so they don’t collide:
Now, we should have the following:
Configuration
Now we create a configuration file that ties all of the identities up. Start editing ~/.ssh/config
:
Delete all of the cached keys:
If you see the error message Could not open a connection to your authentication agent.
you’ll need to run the following:
Add your keys
You can now list your keys with:
You can add your keys back in with the following:
That’s it!