Friday, April 23, 2021

Gitlab repositories and ssh keys Pt 1

We have been using https authentication for a while in my current organization for accessing git.
As the number of repositories I have been working on increased, I found it difficult to do this manually. So I decided to use ssh keys to access my forks of the actual repositories.

So my access model is like below.
1. I add a SSH key for my office desktop in gitlab.
2. Then I modify settings in all my forks to add and enable the ssh key for access.
3. Then I create a folder where I'll keep all this code. Then I clone everything to this folder. 
4. And lastly I use a small shell script to run git pull so that I can update these with one command and no pesky passwords.

From security perspective though, I have to ensure my desktop is not stolen and my keys are secure. Lets see the steps in detail in next parts.