Adding your SSH key to GitLab
In order for GitLab to know who we are and check whether we are authorized to commit certain code, we use our SSH key. The combination of the public key and the private key can tell GitLab that we are authorized, and GitLab will allow the operation to be performed.
How to do it…
To set up your SSH key, perform the following steps:
- Open GitLab and go to your account settings.
- Click on SSH.
- Click on Add SSH Key.
- To get information about your SSH key, enter the following command in your terminal. If you're using Windows, go to step 7:
$ cat ~/.ssh/id_rsa.pub
- You should copy the entire content of the output in step 4, as shown in the following screenshot:
- If you're not using Windows, you can move to step 11.
- Open the Windows explorer and move to
C:\Users\your_username\.ssh
. - Right-click on id_rsa.pub and click on Open.
- When asked for the program you want to use, select Notepad.
- Select the entire content of the file that contains the SSH key.
- We now paste the...