How to generate a SSH RSA key

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 que…


This content originally appeared on DEV Community and was authored by Maxime Guilbert

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! 🍺


This content originally appeared on DEV Community and was authored by Maxime Guilbert


Print Share Comment Cite Upload Translate Updates
APA

Maxime Guilbert | Sciencx (2023-05-15T14:16:00+00:00) How to generate a SSH RSA key. Retrieved from https://www.scien.cx/2023/05/15/how-to-generate-a-ssh-rsa-key/

MLA
" » How to generate a SSH RSA key." Maxime Guilbert | Sciencx - Monday May 15, 2023, https://www.scien.cx/2023/05/15/how-to-generate-a-ssh-rsa-key/
HARVARD
Maxime Guilbert | Sciencx Monday May 15, 2023 » How to generate a SSH RSA key., viewed ,<https://www.scien.cx/2023/05/15/how-to-generate-a-ssh-rsa-key/>
VANCOUVER
Maxime Guilbert | Sciencx - » How to generate a SSH RSA key. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2023/05/15/how-to-generate-a-ssh-rsa-key/
CHICAGO
" » How to generate a SSH RSA key." Maxime Guilbert | Sciencx - Accessed . https://www.scien.cx/2023/05/15/how-to-generate-a-ssh-rsa-key/
IEEE
" » How to generate a SSH RSA key." Maxime Guilbert | Sciencx [Online]. Available: https://www.scien.cx/2023/05/15/how-to-generate-a-ssh-rsa-key/. [Accessed: ]
rf:citation
» How to generate a SSH RSA key | Maxime Guilbert | Sciencx | https://www.scien.cx/2023/05/15/how-to-generate-a-ssh-rsa-key/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.