How to Create SSH Key in Windows 10/11

Windows Topic

October 10, 2022 by Ashley

How to Create SSH Key in Windows 1011

To Create SSH Key in Windows, three different methods are available. SSH Key in Windows enables you to establish a secure connection between two computers. The Secure Shell grants access to the remote user by matching the keys. Private and public SSH keys are provided in pairs. SSH uses a key pair for authentication, with the associated private key being stored on a remote server and the corresponding public key being stored on a local workstation (machine). Obviously, the private key is not supposed to be shared and must remain secret and secure. The public key would be placed on the remote server that you’d like to access to be shared.

From a remote location, SSH enables you to transfer files, commands, forward ports, and more. In this article, you will learn How to Create SSH Key in Windows 10/11. To purchase your own Windows VPS and achieve the fastest VPS available in +15 locations, find your considered cheap plan and enjoy our 24/7 support.

Tutorial Create SSH Key in Windows 10/11

Previously on the OperaVPS blog, Linux users became experts in the setup and using SSH Key on their Linux Servers. It is time to help Windows users to find out what are the 3 methods of creating SSH keys in Windows since the first step of using SSH keys is to create them. Join us with this article to review all you need to know to be able to create SSH Key in your Windows.

Prerequisites to Create SSH Key in Windows 10/11

To let this guide work correctly, make sure you have checked the below options.

  • A system running Windows 10
  • A user account with administrative privileges
  • Command prompt accessibility
  • An Internet browser (optional, to download PuTTY)

1. How to Generate an SSH key in Windows 10/11

The first method we are going to discuss is Generating an SSH key in Windows with OpenSSH Client. To do this, you need to Check if the OpenSSH Client is installed or not.

First, open Settings and click Apps.

How to Generate an SSH key in Windows

Then, click Optional Features to go on.

 

Verify if OpenSSH Client is Installed

At the end of the list, you can verify if OpenSSH Client is listed or not. If it has not been generated yet, click the plus-sign next to Add a feature. Finally, find and select OpenSSH Client to click Install.

find and select OpenSSH Client

 

At this point, to open Command Prompt, follow the below path.

Press the Windows Key>type cmd>Right click Command Prompt>Click Run as Administrator

Note: You will be asked ‘’Do you want to allow this app to make changes to your device?’’ Click Yes on this pop-up to continue.

Open-Command-Prompt

Now, you are ready to use OpenSSH to generate an SSH Key Pair. Once the command prompt is opened, run the command below and hit Enter. You can do this with both the Command prompt and Windows Terminal.

ssh-keygen

use OpenSSH to generate an SSH Key Pair

In this way, the SHH Key would be generated automatically. To use another algorithm, you can refer to Generate a new SSH Key on GitHub.

When you are prompted to choose a name for your Key and save it in a specific location, you can use the default name or write down your own. If you are using multiple Key pairs, you are recommended to give different names to keys to be able to distinguish between keys later. However, the system will save the keys to C:\Users\your_username/.ssh/id_rsa.

Next, you will be asked to enter a passphrase. We recommend you do this and secure your key. But if you do not prefer this, just hit Enter to skip this step.

As a result, the Key pair would be generated by the system, and you can see the key fingerprint and a random art image. So, to navigate to C:\Users\your_username/.ssh, open your file browser.

Two files will be displayed. Usually, the public key is identified with the .pub extension. The identification is saved in the id_rsa file and the public key is labeled id_rsa.pub. This is your SSH key pair. To check the content of both the private and public keys, use Notepad.

Command Prompt Windows10 11

2. How to Generate SSH Keys in Windows 10/11 Using PuTTY

Before OpenSSH, PuTTY was a well-known and widely used program to communicate with a server for years in Windows. Offering a method for creating SSH Keys, PuTTY provides some helper programs. PuTTY Key Generator is one of them.

To install PuTTY, open your favorite browser and open its developer page to download the installer. By clicking on the downloaded file twice, follow the installation wizard and finish it. Once the first dialog of the installation wizard is up, click Next.

Install PuTTY on Windows 10 11

Select the destination folder. If you do not need to change the default installation configuration, click Next to move on.

PuTYY destination folder

In this step, you should select PuTTY product features to be installed. If you do not consider any specific options, let it be continued by default. To do this, just click Install.

select product features for installing PuTTY

Click Yes on the Do you want to allow this app to make changes to your device pop-up when you are prompted. And click Finish to exit the installation Wizard when the process is complete.

complete PuTTY installation Wizard

 

After a successful installation, it is time to run the PuTTY SSH Key Generator. To do this, follow the below path.

Press the Windows Key>Type puttygen, right-click PuTTYgen under Best Match>Click Run as administrator.

Click Yes on the Do you want to allow this app to make changes to your device pop-up when you are prompted.

PuTTYgen in apps menu

Then, you are ready to use PuTTY to create a pair of SSH Keys.

Several algorithms are offered by the PuTTY Keygen tool. RSA keys, a classic and widely-used type of encryption algorithm will be generated. Other ones are DSA, ECDSA, Ed25519, and SSH-1 (RSA).

select “RSA”

Select your considered option under the Parameters heading before generating the key pair, if you wish to have a different encryption algorithm. Now, follow the two below steps:

Click Generate in the PuTTY Key Generator window.

Move the cursor around in the gray box several times to fill up the green bar.

PuTTY Key Generator

To save the public key, follow the below path:

Click the button labeled Save public key>Choose your desired location to save the key>Give the key a name (e.g., putty_key.pub).

Use PuTTY to Create a Pair of SSH Keys

And finally, to save the private key, at the top of the window select Conversation>click Export OpenSSH Key.

Click Yes when you are asked if you want to save a key without a passphrase. In the end, you should choose a location to save the key and give the key a name.

Save the private key

How to use your SSH Keys on Windows 10/11

After a successful installation and generating SSH Keys, you can start using your SSH keys. To do this, you should copy your public SSH key to the system you want to connect to. Utilize your personal SSH key on your computer. If your private key and the public key match, access will be granted.

3. How to Generate Keys in WSL

This method is almost alike to the Command Prompt and is used by those who are WSL users. It is similar to Windows but unlike Windows, you need to specify whether you want an RSA key or something like Ed25519. While you have installed Ubuntu Linux, open up Windows Terminal.

To create an ”RSA-4096” like key, run the following command.

ssh-keygen -t rsa -b 4096

To provide Ed25519, type:

ssh-keygen -t ed25519 -C "your@email.address"

On Windows, Microsoft uses your username and the name of your PC for this automatically, but here, you are recommended to add your email address as an identifier. To generate multiple keys for different sites just tag something like “_github” at the end of the filename.

Conclusion

In this article, you learned how to Create SSH Key in Windows 10/11. Three different methods were explained in detail to generate SSH key pairs on a Windows 10/11 system. Now, you can use the SSH keys to connect to a remote system without the use of passwords. As you saw, it is really easy to generate SSH keys in any of the reviewed methods. You are recommended to go with the Windows Command Prompt option if you have not installed PuTTY already. Also, users who prefer Linux would use another method.

If you encounter any problems, please do not hesitate to contact us. Our technical support team will try our best to solve your problems.

​ ​ ​ ​

About the Author Ashley

Leave a Reply

Your email address will not be published. Required fields are marked *