Generate and Setup SSH Key to Your GitLab Account

Generate and Setup SSH Key to Your GitLab Account

SSH stands for Secure Shell or Secure Socket Shell used for managing the networks and also authenticates to the GitLab server without using username and password each time. You can set the SSH keys to make a secure connection between the computer and GitLab.

Download GitBash

Git Bash is an application for Microsoft Windows environments which provides all git features in command line plus most of standard Unix commands.To download Git BAsh click here.After downloading the Git Bash open and run this below commandssh-keygen

After running above command it will prompt for
“Enter file in which to save the key (//.ssh/id_rsa):”, just type file name and press enter. Next a prompt to enter password shows
“Enter passphrase (empty for no passphrase):”.
Then again you will be asked for
“Enter same passphrase again:”.
Just hit enter.You will see the generated SSH key as shown in the below image.

Set SSH Key to your GitLab Account

To set SSH key login to your GitLab account and click on the Settings option.

And in the left side menu click on SSH keys.See below image for your reference.

Now get your SSH key content which is generated already.Open the file through editor and copy the content of the file and paste into the SSH key section in the GitLab.

Paste the content into the Key field and also you can set expiry date for the SSH key.If you left blank expiry date then this will set to never expires. See below image for your reference.

Hit the add button to save SSH key and you will get final screen as below.

Thank you for reading this post. we hope you like this Post, Please feel free to comment below, your suggestion. if you face any issue with this code let us know. We’d love to help! Stay tuned!