Login and SSH key generation

Note

This process will only be done once for the first GitLab connection

First login to git2.boost-lab.net

You have received a confirmation email asking you to define a new password:

_images/Picture110.png

Figure 14 Confirmation email

Once the password has been defined, it will be possible to login normally to the server

SSH Key certificate creation

The first thing to do once the login has been successful is to define an SSH Key [1] that will allow the local machine to push and pull from the repository.

GitLab navigation

To do so, navigate to the top-right corner of the GitLab interface and click on your user image (Figure 15). After having selected the Profile menu click on the Edit profile button represented as a pen in the top-right GitLab interface (Figure 16):

_images/Picture210.png

Figure 15 User menu

_images/Picture310.png

Figure 16 Edit profile button

Navigate to the SSH Keys tabs (Figure 17). The next step will consist on generating your own SSH Key.

_images/Picture47.png

Figure 17 SSH Keys tab

SSH Key verification

Before generating an SSH Key, you should first see if you already have a local SSH Key. To do so, open a terminal command and type the following command:

MacOS / Linux:

cat ~/.ssh/id_rsa.pub

Windows:

type %userprofile%\.ssh\id_rsa.pub

If the terminal output indicates that the file does not exist, go to section C. If the terminal shows an output similar to the one in Figure 18, this means that you already have an SSH key: go to section D directly.

_images/Picture51.png

Figure 18 Terminal result when a SSH Key exists

SSH Key creation

MacOS and Linux users can follow these steps to generate their SSH Key:

ssh-keygen -t ed25519 -C "your_title"

Note

We are gradually moving from the rsa key to the ed25519 key. If you are using an ed25519 key, mentally replace rsa with ed25519 throughout this document.

The terminal will ask to which file the Key shall be exported, press Enter to use the default path. It will then ask you do define a passphrase for the SSH Key. The passphrase is a password that will be asked whenever the SSH key will be used. The output of the terminal should look like Figure 19:

_images/Picture61.png

Figure 19 SSH Key generation terminal output

If you are running Windows as your default OS, this link will explain the procedure to create a new SSH Key.

However, if you are working with EGit, the procedure to generate an SSH key is faster and easier:

Open “Window” > “Preferences” and ensure that your SSH2 home is configured correctly (usually this is ~/.ssh) and contains your SSH2 keys

_images/Picture71.png

Figure 20 SSH EGit menu

If you don’t have SSH keys yet you may generate them on the second tab “Key Management” of this dialog. When you select “Generate RSA Key” you will get the information presented to you. Define a passphrase that will be associated to your SSH key. The Figure 21 shows this window:

_images/Picture81.png

Figure 21 SSH Key generation

Copy the text that is highlighted in figure 9 and select Save Private Key...

Copying the SSH Key to GitLab

To copy the SSH public key, use the following commands if the SSH key was not generated with EGit.

MacOS:

pbcopy < ~/.ssh/id_rsa.pub

Linux:

xclip -sel clip < ~/.ssh/id_rsa.pub

Windows (if PuTTy used):

type %userprofile%\.ssh\id_rsa.pub | clip

Then simply paste it in the GitLab interface (the title will be completed automatically):

_images/Picture91.png

Figure 22 Pasting the public SSH Key

Clicking on Add key will upload your public key.

Note

You are now able to download and upload files to the server

Footnotes

[1]Secure Shell (SSH) is a cryptographic network protocol for operating network services securely over an unsecured network: wikipedia.