How Do You Create an RSA Private/Public Key Pair with OpenSSH in Windows?

Problem scenario
You have OpenSSH installed on a Windows machine.  You are in a PowerShell prompt as Administrator in the directory where the ssh-keygen.exe file is.  You run this:  .\ssh-keygen.exe -t rsa
You get "Generating public/private rsa key pair."  No new prompt appears.  It hangs (or stalls) for a long time.  You wait, and find that it is essentially frozen.  You control-c to interrupt it and move on.

You are in a PowerShell prompt as Administrator in the directory where the ssh-keygen.exe file is.  You run this:  .\ssh-keygen.exe -t rsa -f C:\\Program Files\\OpenSSH\\Openssh-Win64\\newfile
No new prompt appears.  It hangs (or stalls) for a long time.  You wait, and find that it is essentially frozen.  You control-c to interrupt it and move on.

How do you generate a public/private rsa key pair?

Possible Solution #1
Open a cmd prompt. You do not need to do it as Administrator.  cd to the directory where ssh-keygen.exe is.  Use this command ssh-keygen -t rsa (with no .exe).  This creates a private/public key pair.

Alternative solution #2
Open a PowerShell prompt but not as administrator. Run this command: ssh-keygen -t rsa

Leave a comment

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