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:
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.
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.
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:
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
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:
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):
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. |