Languages
[Edit]
EN

SSH - generate keys with ssh-keygen

6 points
Created by:
Jun-L
413

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:

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

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

$ ssh-keygen -t ed25519 -C 'john@gmail.com'
Generating public/private ed25519 key pair.
Enter file in which to save the key (/c/Users/john/.ssh/id_ed25519):
Created directory '/c/Users/john/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/john/.ssh/id_ed25519.
Your public key has been saved in /c/Users/john/.ssh/id_ed25519.pub.
The key fingerprint is:
SHA256:hyUgMhYpv8fT5Q/K4h+zO54yBKZRQp78atzN8OHsbkP john@gmail.com
The key's randomart image is:
+--[ED25519 256]--+
|    ..E..        |
|     = + o       |
|     o . + +     |
|      = S + .    |
|    . + . o .    |
|    . * * o      |
|     o B o o     |
|   . +o&.*       |
|    . @@@++      |
+----[SHA256]-----+

Example output:

generated ssh keys - public + private keys pair
generated ssh keys - public + private keys pair
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join