How to Create SSH Key Pair in Windows

This guide will show you how to generate an SSH key pair in Windows 10 using OpenSSH.

Prerequisites

  • A system running Windows 10, 11 or Windows Server 2016-2022

  • A user account with administrative privileges

  • Access to Windows command prompt

Step 1: Verify if OpenSSH Client is Installed

First, check to see if you have the OpenSSH client installed:

  1. Open the Settings panel, then click Apps.

  2. Under the Apps and Features heading, click Manage optional Features.

../_images/ssh_windows_1.png
  1. Scroll down the list to see if OpenSSH Client is listed.

  • If it’s not, click the plus-sign next to Add a feature.

  • Scroll through the list to find and select OpenSSH Client.

  • Finally, click Install.

../_images/ssh_windows_2.png

This will install app called ssh-keygen.

Step 2: Open Command Prompt

ssh-keygen runs from Windows Command Prompt, so the next step is to open it.

  1. Press the Windows key.

  2. Type cmd.

  3. Under Best Match, right-click Command Prompt.

  4. Click Run as Administrator.

../_images/ssh_windows_3.png

Step 3: Use OpenSSH to Generate an SSH Key Pair

Finally, run ssh-keygen to generate the public and private keys for SSH access to the Destination Earth server.

  1. In command prompt, type the following:

ssh-keygen
../_images/ssh_windows_4.png

Press ENTER three times. This will

  • create a folder /.ssh for the keys as well as

  • file id_rsa for secret key and

  • file id_rsa.pub for public key.

These are the default values.

Warning

If you have created other keys in those same locations, you can define other folder and files instead of just pressing Enter three times.

../_images/ssh_windows_5.png

To see the generated files, navigate to C:/Users/<Your_User_Name>/.ssh with your file explorer.

../_images/ssh_windows_6.png

The image shows default values of files for private and public keys, in files id_rsa and id_rsa.pub, respectively.

What To Do Next

Put your public key on remote server and use your private key to authorize to your VM. To add the public key to remote server see

How to add SSH key from Horizon web console

To connect to the server from Windows:

How to connect to a virtual machine via SSH from Windows 10 Command Prompt

How to access a VM from Windows PuTTY