If you already own an SSH private key but somehow lost your public key, you can re-create or extract the public key on Windows using PuTTY Key Generator (PuTTYGen).

PuTTYGen is a free utility and is available for Windows. You can use PuTTYGen to generate public key from PuTTY Private Key (ppk), PEM, and OpenSSH private key formats.

Step-by-step video guide:

Steps to generate public key from existing SSH private key using PuTTYgen:

  1. Download PuTTY Key Generator (puttygen.exe) from the official website.
    https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html
  2. Launch PuTTYgen.
  3. Click on the Load button on the lower right of the program.
  4. Select your private SSH key from where it is locally stored in your system.

    PuTTYGen by default filters the file type to just display .ppk format. Click on the select list on the lower right and choose All Files to load files of OpenSSH format.

  5. Enter the key's passphrase if requested.
  6. Manually copy the public key displayed on PuTTYGen to a text editor and save it to a file to use in OpenSSH authorized_key file for passwordless login.
  7. Click on the Save public key button.
  8. Select the location and file name of the public key and click on Save.
Discuss the article:

Comment anonymously. Login not required.