Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
courses
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Laurent Heirendt
courses
Commits
e02b1a80
Verified
Commit
e02b1a80
authored
2 years ago
by
Laurent Heirendt
Browse files
Options
Downloads
Patches
Plain Diff
changes to ssh key
parent
f867b0a5
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
2022/2022-06-07_git-trilogy-part-2/slides/ssh.md
+36
-18
36 additions, 18 deletions
2022/2022-06-07_git-trilogy-part-2/slides/ssh.md
with
36 additions
and
18 deletions
2022/2022-06-07_git-trilogy-part-2/slides/ssh.md
+
36
−
18
View file @
e02b1a80
# Key-based authenti
fi
cation
# Key-based authentication
As the first step
Git
L
ab
needs to be able to recognize you. We will use the most secured method: key-based authentication
.
When communicating with the
Git
l
ab
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
\c
rash
\l
ost 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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment