Categories
Blog Tech

How to generate Public & Private SSH Keys on Windows?

Hello, Lets Begin.

Open a Command Prompt/Terminal Window.

Important Alert!: Before going further, there is very important to know. If you have already generated a private/public key pair, don’t do it again!.

Where to find those keys or check if generated or not?

Okay, lets quickly see that step, Open Explorer window and type in address of explorer %userprofile%/.ssh it will open the window for you.

Typing %userprofile%/.ssh

Result of opening the above path. if you already have files will be listed otherwise it would be empty, so you can continue following reading next few steps to generate up the same.

.ssh list keys if already generated on your system or otherwise it list empty

Follow steps if no keys are available in the case.

Lets go back to our open Terminal Window/Command Prompt enter command:

ssh-keygen -b 4096

You are prompted to answer a few questions.

First is “Enter file in which to save the key” Press enter to use the default location.

The next question is “Enter passphrase.” This step is optional, but good to have for better security. Use whatever you like or skip, and then press enter.

Then confirm the passphrase or enter if none.

Once done new keys will be saved to same path under .ssh

For example: C:\your-username\.ssh\id_rsa.pub

Then you can use both the files to upload it under your hosting server to make a communication with your server through terminal window.

To make a connection to hosting server from terminal windows, that’s another topic we will cover them later in new post.

Hope this solves your finding.

Happy Learning