DEV Community

Caio Cesar
Caio Cesar

Posted on • Edited on

Generating SSH Certificate in Windows

Software Requirements

Download and install Open SSL

Download and install Putty Gen

Alt Text

Configuration

Find the OpenSSL installation folder such as:
C:\Program Files\OpenSSL-Win64\bin\

Create a folder named 'cert' inside bin folder.

Open the command prompt as administrator and navigate to the OpenSSL bin folder

cd C:\Program Files\OpenSSL-Win64\bin\
Enter fullscreen mode Exit fullscreen mode

Generate the private key and the CRT in the cert folder:

openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:2048 -keyout cert/privateKey-example.key -out cert/certificate-example.crt
Enter fullscreen mode Exit fullscreen mode

Generate the PFX certificate:

openssl pkcs12 -export -out cert/certificate-example.pfx -inkey cert/privateKey-example.key -in cert/certificate-example.crt
Enter fullscreen mode Exit fullscreen mode

At this poin 3 files should be generated in the cert folder:

Alt Text

Generate a PKCS#1 Private key

openssl pkcs12 -in cert/certificate-example.pfx -nocerts -out cert/privateKey-example.pem
Enter fullscreen mode Exit fullscreen mode

Decrypt the private key to generate the ppk

openssl rsa -in cert/privateKey-example.pem -out cert/teste-privateKey-example-decrypted_key.pem
Enter fullscreen mode Exit fullscreen mode

Execute the Putty Gen program and load the decrypted private key
Save the new private and public key as ppk.

Alt Text

At this point the public and private key could be used for SFTP authentication.

Alt Text

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

Top comments (0)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay