Tutorials

Creating and Adding own ssh-key


Generating your own ssh key for your BOX

This tutorial will run thorough the generation and the addition of the ssh key-pair in to your git lab account. The problem which was constant eating up the brain.

The problem faced was,

While pulling and cloning from the repository git was prompting for password.

Solution

  1. Flush out all the ssh keys and known_hosts from '.ssh' folder
cd ~/.ssh       #navigate to .ssh folder 
rm *            #delete everything present 
  1. Check if still previous key is present, if yes then and also deleted all the keys from '.ssh' folder then restart your box. If not present proceed
ssh-add -l      #list out all the keys installed currently 
  1. Generate the new ssh key as follows,
ssh-keygen -t rsa -C "youremail@domain.com"   #replace with your email id, when prompted press enter to accept the defaults. 
ssh-add ~/.ssh/id_rsa                         #this will add the key into ssh-agent 
xclip -sel clip < ~/.ssh/id_rsa.pub            #by-default it creates id_rsa file. if you have changed the defaults then replace that with this 

with above steps now you have the key generated and copied it into the clipboard. Now, we have to tell the gitlab about our new key.

  1. goto git.fabacademy.org -> sign in with FABLAB
  2. Once logged in goto the profile preferences, and look out for ssh keys section, open that section
  3. Then click on green colored 'Add Key' button and paste the key into the text-box provided. and enter the title for your key, it can be anything but by-default it takes as you email id.
  4. Now try to push or clone.