warning
I am assuming this is a new machine setup or a machine which is occasionally used and does not contain any previous setup. And for most part I will be talking about Linux machine
Setting up SSH key
Adding SSH key in gitlab
- Sign in to gitlab
- Click on your user profile. You should see a dropdown modal
- Click preference on it. You will be taken to the preference page of your profile
- Look for SSH keys on the left navigation.
If left navigation is closed click on "Sidebar Navigation" button or press
Ctrl+\
. Navigation sidebar will open. - You should now be in SSH keys page
- Locate Add new key button
- Click on it ☝️ (Add new key)
- In your machine
- Linux
- Windows
Navigate to user directory
cd ~
Locate .ssh
directory, it is an hidden directory, navigate within it
cd ~/.ssh
Copy public key that is generated
cat <encrypted_file_name>.pub
copy the contents
Open Run, ``
%userprofile%
- Locate
.ssh
directory, navigate within it - Copy public key that is generated, by opening the file in notepad
- Copy the contents
- Past the copied key into key text area
- Pick a title so you could differentiate when and where the token is located
- Choose
Usage type
. I prefer to use the same token for Authenticating and signing, you could have different token setup - Choose the duration of the key when it should be invalidated.
- My suggestion/steps would get outdated, leaving gitlab ssh key reference link