Git via SSH – multiple keys management

In order to use git over ssh, you need ssh keys. When you want to use multiple keys for different domains, you have to know where and how to configure it. I always forget where this configuration file is stored, so here I make a short note about it. Ju…


This content originally appeared on DEV Community and was authored by Mikołaj Buchwald

In order to use git over ssh, you need ssh keys. When you want to use multiple keys for different domains, you have to know where and how to configure it. I always forget where this configuration file is stored, so here I make a short note about it. Just edit ~/.ssh/config, e.g.:

vim ~/.ssh/config

Then put there something like:

Host github.com
 HostName github.com
 IdentityFile ~/.ssh/id_rsa_github
Host gitlab.com
 HostName gitlab.com
 IdentityFile ~/.ssh/id_rsa_gitlab

Et violà!

Source: https://superuser.com/a/232406/950943


This content originally appeared on DEV Community and was authored by Mikołaj Buchwald


Print Share Comment Cite Upload Translate Updates
APA

Mikołaj Buchwald | Sciencx (2022-06-23T21:11:27+00:00) Git via SSH – multiple keys management. Retrieved from https://www.scien.cx/2022/06/23/git-via-ssh-multiple-keys-management/

MLA
" » Git via SSH – multiple keys management." Mikołaj Buchwald | Sciencx - Thursday June 23, 2022, https://www.scien.cx/2022/06/23/git-via-ssh-multiple-keys-management/
HARVARD
Mikołaj Buchwald | Sciencx Thursday June 23, 2022 » Git via SSH – multiple keys management., viewed ,<https://www.scien.cx/2022/06/23/git-via-ssh-multiple-keys-management/>
VANCOUVER
Mikołaj Buchwald | Sciencx - » Git via SSH – multiple keys management. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/06/23/git-via-ssh-multiple-keys-management/
CHICAGO
" » Git via SSH – multiple keys management." Mikołaj Buchwald | Sciencx - Accessed . https://www.scien.cx/2022/06/23/git-via-ssh-multiple-keys-management/
IEEE
" » Git via SSH – multiple keys management." Mikołaj Buchwald | Sciencx [Online]. Available: https://www.scien.cx/2022/06/23/git-via-ssh-multiple-keys-management/. [Accessed: ]
rf:citation
» Git via SSH – multiple keys management | Mikołaj Buchwald | Sciencx | https://www.scien.cx/2022/06/23/git-via-ssh-multiple-keys-management/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.