To generate a SSH RSA key, you must use a Terminal on Linux or WSL or the git terminal on Windows.
Once you have it ready, you can execute the following command :
ssh-keygen -t rsassh-keygen -t rsa
Directly you will need to answer to some questions.
The first one is to know where you want to store your key? (It includes the file path and the file name)
Enter file in which to save the key (/home/dummy/.ssh/id_rsa):
Next, it will ask you to enter a passphrase to eventually add a layer of security to use this key
Enter passphrase (empty for no passphrase):
then the confirmation of the passphrase
Enter same passphrase again:
For security reasons, it's highly recommanded to set a passphrase! But for multiple reasons you may need to don't set a passphrase. Just ask you if you really need to avoid it, just to be sure.
Then something similar than the following should be printed
Your public key has been saved in /home/dummy/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:IP109CmXCOaMvnu2UXbnoJuiVFmh3u6aN7DLalg4uJQ dummy@dummy
The key's randomart image is:
+---[RSA 3072]----+
| o o |
| . = + + o |
| . + = = = |
| o = = o |
| o .. S + o . |
| E o .o.+ o + |
| . . +o .oo . |
| . ...o=+oo |
| .+=**+. |
+----[SHA256]-----+
Once done, congrats you have your SSH RSA keys! You can find know 2 files:
-
id_rsa.pub
(as I named id_rsa my key) the public key -
id_rsa
the private key
Be sure to store your private key in a safe place!
I hope it will help you! 🍺
Top comments (0)