How to Generate an SSH Key in Windows 11

An SSH key is used for authentication between the client and server that are communicating using the SSH (Secure Shell) network protocol. It allows a safe and secure channel on top of an unsafe network for communication between systems. This secure connection can be used to gain remote access to a machine on the other end. Here we will detail the steps to generate this SSH key on a Windows 11 PC.

Step 1 – Install OpenSSH Client Feature

 

At first, you need to check if the OpenSSH Client feature is installed on your PC or not. If it is already present then you can continue with generating the key else, you need to install it.

1. Press Windows and I keys simultaneously to open the Windows Settings page.

2. Select the Apps tab in the left pane.

3. Click on Optional Features on the right side.

 



Apps Optional Features Min

 

4. In the search box below Installed features type OpenSSH Client to check if it is already installed.

5. If you see the feature present then continue to Step 2.

 

Locate Openssh Installed Feature Min

 

6. In case the feature is not installed, click on the View features button associated with Add an optional feature.

 

Optional Features View Features Min

 

7. Search for OpenSSH Client in the list.

8. Check the box associated with it and click on Next.

 

Search Openssh Feature Min

 

9. Click on the Install button.

 

Install Openssh Client Feature Min

 

10. Once it is installed, restart your PC and move to Step 2 to generate the SSH key.

 

Step 2 – Create an SSH Key

 

1. Hit the Windows key and type cmd in the search box.

2. Right-click on Command Prompt and choose Run as administrator.

 

Command Prompt Run As Admin Windows Key

 

3. If prompted by User Access Control, click on Yes.

4. Execute the command below

ssh-keygen

5. On executing the above command, it will ask Enter file to save the key with a default location mentioned.

Note: The default location for saving the keys is C:\Users\<username>\.ssh\id_rsa

6. Now if you hit Enter the SSH key will be saved in the above default location. Else if you want you can change the location by typing the new path.

7. Next it gives an option to create a password (passphrase) for the SSH key created.

8. Press the Enter key if you want to proceed without creating a passphrase.

9. If you want to secure the key then type a password and confirm it by retyping it. Remember this password as this is needed while using the SSH key every time.

10. Now the key will be created and you see the fingerprint of the key and SHA256 hash value. Also, you will see the RSA algorithm that has been used.

 



Generate Ssh Key Command Prompt Min

 

11. You can now use your key in the path mentioned below

C:\User\<username>\.ssh.

It will be present in the id_rsa.pub file.

 

Location Of Ssh Key Min

 

 

That’s it!

We hope you are now able to generate an SSH key pair for communication between two entities over a network.