Assuming you installed all the necessary basic tools from exercise 01
- Change to your home directory by typing:
cd
- Check if the hidden folder
.ssh
exist by typing:
ls -a
Note: the -a
options shows hidden files that start with a dot
3. If it does not exist create the folder by running:
mkdir .ssh
- Change into the folder
cd .ssh
- Create the ssh-key by issuing the command:
ssh-keygen -t rsa
It will ask you:
- to specify the filename: (if you don't have any other keys leave it as it is) and press enter
- enter a passphrase: leave it empty and press enter twice
- Print the public key: by typing:
cat id_rsa.pub
Note:
- if you chose another name replace id_rsa
- the
pub
extension is the public key
- Copy the whole public key out put starting with
ssh-rsa
and including everything until the end - Go to your gitlab project site, click on your icon and then under settings
- On the left hand side in the panel click on SSH Keys and add your ssh key