SSH - generate keys with ssh-keygen

6 points
Created by:

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 ''

Generated keys location: ~/.ssh/id_ed25519 and ~/.ssh/


or (backward compability version):

ssh-keygen -t rsa -b 4096 -C ''

Generated keys location: ~/.ssh/id_rsa and ~/.ssh/


Example usage (with ed25519):

$ ssh-keygen -t ed25519 -C ''
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/
The key fingerprint is:
The key's randomart image is:
+--[ED25519 256]--+
|    ..E..        |
|     = + o       |
|     o . + +     |
|      = S + .    |
|    . + . o .    |
|    . * * o      |
|     o B o o     |
|   . +o&.*       |
|    . @@@++      |

Example output:

generated ssh keys - public + private keys pair
generated ssh keys - public + private keys pair
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
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.

❤️💻 🙂