Let's use the " specific key per account" method. Specific key per account : id_rsa_github id_rsa_bitbucket id_rsa_gitlab We can use the same SSH key to do that or we can use a specific key per account.
We are going to create some default identities. How could I define everything to work properly through SSH Keys so that my system relies on the proper SSH key based on the identity it has to use.įor this particular post, we are going to connect a personal and professional identity for each accounts. I have a personal accounts on GitHub, Bitbucket and GitLab and I have some work accounts on Github, Gitlab and Bitbucket. So we can clone, push and pull to repositories with the proper identities.Įvery command to perform these actions is described below. Then we are going to add the relevant keys to the corresponding service (Github, Gitlab and Bitbucket). Then we are going to configure which key must be used based on the host. To sum up what we are going to do, we are going to create a bunch of SSH keys for our personal and professional identities on Github, Gitlab and Bitbucket and add them to the SSH-Agent. So that post is as much for future me than it is for present you, as you are reading it.
Everytime I get a new computer (which is not that often but often enough to write this), I am "struggling" with Git configuration for the different code repository accounts I have.Īnd everytime I have a new computer, I can't remember what I did a few years/months ago to set it up properly.