How to Generate and Add SSH Key in Gitlab?
Here, i will show you how to generate and add ssh key in gitlab. it's simple example of how to add ssh key in gitlab. i would like to show you how to add ssh key to gitlab repository. i would like to show you how to add ssh key into gitlab ubuntu. Alright, let’s dive into the steps.
If you need to generate ssh key and add to your gitlab, gitlab or any other account then i will help you how to generate ssh key in your ubuntu 22.10, ubuntu 22.04, ubuntu 21.10, ubuntu 21.04, ubuntu 20.04, ubuntu 18.04 and ubuntu 16.04 server. after that i will also give you step how to get generated ssh key and how to add ssh key in gitlab account.
so let's see bellow commands for setup ssh key in ubuntu linux server.
Generate SSH Key in Ubuntu
Now, let's run bellow "ssh-keygen" command to generate ssh key.
Syntax:
ssh-keygen -t rsa -b 4096 -C "your_email@domain.com"
Command:
ssh-keygen -t rsa -b 4096 -C "itsolutionstuff@gmail.com"
Now, you will see following layout as bellow:
Now, you can go ".ssh" folder and get ssh key from there:
cd ~/.ssh
ls
Now, you will see following layout as bellow:
cat id_rsa.pub
Now, you can copy your ssh key from here:
Add SSH Key in Gitlab Account
Now, Here i will give you list of step how to add your generated ssh key into gitlab account for now.
Step 1: Go to gitlab Account: Click Here. If you don't have account then you can create.
Step 2: Click to right side user icon and then click on Edit Profile from list as bellow:
Step 3: Now click on Left side "SSH Keys" list and click on Add SSH Key as like bellow:
Clone gitlab Repository:
Now you are ready to clone your gitlab project in your server using following command:
Syntax:
git clone git@gitlab.com:user_name/repo_name.git
Command:
git clone git@gitlab.com:savanihd/Laravel-8-CRUD.git
i hope it can help you...
Hardik Savani
I'm a full-stack developer, entrepreneur and owner of ItSolutionstuff.com. I live in India and I love to write tutorials and tips that can help to other artisan. I am a big fan of PHP, Laravel, Angular, Vue, Node, Javascript, JQuery, Codeigniter and Bootstrap from the early stage. I believe in Hardworking and Consistency.
We are Recommending you
- How to Generate SSH Key in Ubuntu Server?
- How to Check Apache Access & Error Log Files in Ubuntu Server?
- How to Whitelist/Allow IP Address in Apache Ubuntu?
- How to Restrict/Block IP Address in Apache Ubuntu?
- How to Install Laravel in Ubuntu Server?
- How to Set Up Password Authentication with Apache in Ubuntu?
- How to Install Apache PHP MySQL and Phpmyadmin on Ubuntu?
- How to Install Phpmyadmin in Ubuntu Server?
- How to Install MySQL in Ubuntu Server?
- How to Install Apache Web Server on Ubuntu Server?