If you have an existing SSH private key but no longer have the public key, you can easily recreate the public key using PuTTY Key Generator (PuTTYGen) on Windows. This tool supports extracting public keys from various private key formats, such as PuTTY Private Key (PPK), PEM, and OpenSSH.
PuTTYGen is a free utility available for Windows, designed to handle SSH key generation and conversion tasks. It provides a simple way to recover your public key without generating a new key pair, which is essential for maintaining secure connections.
Using PuTTYGen, you can quickly extract the public key you need for authentication. This process is straightforward and ensures that you can continue using your SSH setup even if the original public key is lost.
Steps to generate public key from existing SSH private key using PuTTYgen:
- Download PuTTY Key Generator (puttygen.exe) from the official website.
https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html
- Launch PuTTYgen.
- Click on the Load button on the lower right of the program.
- 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.
- Enter the key's passphrase if requested.
- 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.
- Click on the Save public key button.
- Select the location and file name of the public key and click on Save.
Mohd Shakir Zakaria is an experienced cloud architect with a strong development and open-source advocacy background. He boasts multiple certifications in AWS, Red Hat, VMware, ITIL, and Linux, underscoring his expertise in cloud architecture and system administration.
Comment anonymously. Login not required.