Skip to content
Snippets Groups Projects
Verified Commit e02b1a80 authored by Laurent Heirendt's avatar Laurent Heirendt :airplane:
Browse files

changes to ssh key

parent f867b0a5
No related branches found
No related tags found
No related merge requests found
# Key-based authentification
# Key-based authentication
As the first step GitLab needs to be able to recognize you. We will use the most secured method: key-based authentication.
When communicating with the Gitlab server, you need credentials (username and password). Disadvantage: you have to enter the password every time.
You need to do this setup just ones (and repated if you change\crash\lost your laptop).<br>
- Open terminal (command line)
- Type `ssh-keygen -t ed25519 -C firstname.lastname@uni.lu`
- Accept the suggested filename and directory (press Enter):<br>
<img height="100px" src="slides/img/keyGen.png">
- Press Enter without entering the passphrase. <br>
Better: identify your laptop once, and then you do not need to enter the credentials anymore.
A public and private key are generated and stored in specific location on your laptop. Now you need to add the public key to your GitLab account.<br>
- Copy the contents of your public key file. You can do this manually or<br>
- macOS: `tr -d '\n' < ~/.ssh/id_ed25519.pub | pbcopy`
- Windows: `cat ~/.ssh/id_ed25519.pub | clip`
- Now let's move to GitLab https://gitlab.lcsb.uni.lu/
You need to do this setup just once (and repeat if you change your computer).<br>
- Open VS code
- Browse to `Terminal` > `New Terminal`
- Type this command at the command prompt: `ssh-keygen -t ed25519 -C firstname.lastname@uni.lu`
- Accept the suggested filename and directory (press `Enter`):
```
Generating public/private ed25519 key pair.
Enter file in which to save the key (/home/user/.ssh/id_ed25519):
```
- Press `Enter` (entering the passphrase is optional).
# Key-based authentification
- On the top bar, in the top right corner, select your avatar.
- Select **Preferences**.<br>
# Key-based authentication
A public and private key are generated and stored in specific location on your laptop. Now you need to add the public key to your GitLab account:
Copy the contents of your public key file:
- macOS: `tr -d '\n' < ~/.ssh/id_ed25519.pub | pbcopy`
- Windows: `cat ~/.ssh/id_ed25519.pub | clip`
Now, let's move to GitLab https://gitlab.lcsb.uni.lu/
- On the top bar, in the top right corner, select your avatar, then `Preferences`.
<center>
<img height="200px" src="slides/img/addSSHavatar.png">
- On the left sidebar, select **SSH Keys**.
</center>
# Key-based authentication
- On the left side, select **SSH Keys**.
- In the **Key** box, paste the copied public key. Make sure it starts with *ssh-ed25519* and finishes with your e-mail.
- In the **Title** box, type a description, like *Work Laptop*.<br>
<img height="400px" src="slides/img/addSSH.png">
\ No newline at end of file
<center>
<img height="400px" src="slides/img/addSSH.png">
</center>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment