EN
SSH - generate keys with ssh-keygen
6 points
In this short article, we would like to show how to generate ssh keys (private and public keys pair).
Those kays can be used to get secured ssh keys based connection with any git repository - github, gitlab, etc.
Runn following command:
xxxxxxxxxx
1
ssh-keygen -t ed25519 -C 'your-email@some-domain.com'
Generated keys location: ~/.ssh/id_ed25519
and ~/.ssh/id_ed25519.pub
.
or (backward compability version):
xxxxxxxxxx
1
ssh-keygen -t rsa -b 4096 -C 'your-email@some-domain.com'
Generated keys location: ~/.ssh/id_rsa
and ~/.ssh/id_rsa.pub
.
Example usage (with ed25519
):
xxxxxxxxxx
1
$ ssh-keygen -t ed25519 -C 'john@gmail.com'
2
Generating public/private ed25519 key pair.
3
Enter file in which to save the key (/c/Users/john/.ssh/id_ed25519):
4
Created directory '/c/Users/john/.ssh'.
5
Enter passphrase (empty for no passphrase):
6
Enter same passphrase again:
7
Your identification has been saved in /c/Users/john/.ssh/id_ed25519.
8
Your public key has been saved in /c/Users/john/.ssh/id_ed25519.pub.
9
The key fingerprint is:
10
SHA256:hyUgMhYpv8fT5Q/K4h+zO54yBKZRQp78atzN8OHsbkP john@gmail.com
11
The key's randomart image is:
12
+--[ED25519 256]--+
13
| ..E.. |
14
| = + o |
15
| o . + + |
16
| = S + . |
17
| . + . o . |
18
| . * * o |
19
| o B o o |
20
| . +o&.* |
21
| . @@@++ |
22
+----[SHA256]-----+
Example output:
