Last active
February 28, 2022 12:32
-
-
Save loburets/c8add517a4932894b440cb3b5b453282 to your computer and use it in GitHub Desktop.
Switch ssh credentials to use another key for git when you use multiple accounts and return back
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# to switch: | |
ssh-add -D && ssh-add ~/.ssh/id_rsa_personal | |
ssh-add -D && ssh-add ~/.ssh/id_rsa | |
ssh-add -D && ssh-add ~/.ssh/id_rsa_gmail | |
# to generate such file: | |
ssh-keygen -t ed25519 -C "[email protected]" -f ~/.ssh/id_rsa_gmail | |
ssh-keygen -t ed25519 -C "[email protected]" -f ~/.ssh/id_rsa_personal | |
ssh-keygen -t ed25519 -C "Dmitry L for work" -f ~/.ssh/id_rsa | |
# to see public key | |
cat ~/.ssh/id_rsa_gmail.pub | pbcopy | |
cat ~/.ssh/id_rsa_personal.pub | pbcopy | |
cat ~/.ssh/id_rsa.pub | pbcopy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Helps if you have personal and work ssh keys on the same user