How to add SSH key to a GitLab account

How to add SSH key to a GitLab account

Git is a distributed version control system, which means the user can work locally but also can share or " push" any changes to other servers. Before the user can push any changes to a GitLab server, it may need a secure communication channel for sharing information.This SSH protocol provides this security and allows the user to authenticate to the GitLab remote server without supplying the username or password each time. This tutorial covers the configuration process of adding SSH key to a GitLab account.

Configuration procedure

Before starting the configuration procedure, first generate the SSH key in the target local machine which has to be added to the GitLab account.

[user1@localhost git]$ ssh-keygen -t rsa

Run the following command to open the SSH public key file. Now copy the SSH key to the user account.

[user1@localhost git]$ vim /home/user1/.ssh/id_rsa.pub

In the GitLab account, go to Settings option in the profile tab.

Select the SSH keys tab in the user settings and add the copied key from the terminal .

The key has been copied to the GitLab account. Click the Add key option to add the copied key and establish a connection between the GitLab and the local server.

The key has been successfully added in the GitLab account.

Once the SSH key is added logout from the account and login to GItLab again. Now the user can directly clone the project or do any other process without any authentication.

Wasn' t that an easy configuration process? Stay connected to know more about various other aspects of GitLab from our future articles.

Tag : SSH gitlab
FAQ
Q
Where i can find profile menu on gitlab?
A
In the GitLab account, go to Settings option in the profile tab to access your profile.
Q
How to generate SSH key on gitlab?
A
first generate the SSH key in the target local machine which has to be added to the GitLab account using the following command

ssh-keygen -t rsa
Q
how to install GITLAB on ubuntu 18?
A
To install GITLAB on ubuntu 18 Follow this link : "https://www.linuxhelp.com/how-to-install-gitlab---10-7-0-on-ubuntu---18-04/"
Q
What are the similar tool in linux for gitlab?
A
The similar tool in linux for gitlab is gogs
Q
how to install gogs on ubuntu ?
A
To install gogs on ubuntu Follow this link : " https://www.linuxhelp.com/how-to-install-gogs-on-ubuntu-16-04/"