Learning and Sharing
  • Home
  • Blog
  • Linux
  • macOS
  • Virtualization
    • VMware
    • VirtualBox
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server
  • Series
    • Symantec
    • Intune
    • Microsoft Azure
    • Powershell
    • VirtualBox
    • VMware
    • PowerShell Learning
    • Microsoft Graph
  • More
    • Auto Installation
    • AEC Installation
  • Contact
No Result
View All Result
  • Home
  • Blog
  • Linux
  • macOS
  • Virtualization
    • VMware
    • VirtualBox
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server
  • Series
    • Symantec
    • Intune
    • Microsoft Azure
    • Powershell
    • VirtualBox
    • VMware
    • PowerShell Learning
    • Microsoft Graph
  • More
    • Auto Installation
    • AEC Installation
  • Contact
No Result
View All Result
No Result
View All Result

How to Convert OpenSSH Private Key to RSA Private Key

July 10, 2024
in A, Blog, PuTTY
0
ADVERTISEMENT

Table of Contents

Convert OpenSSH Private Key to RSA Private Key

In some cases, you want to convert OpenSSH private key to RSA private key. An OpenSSH private key begin with: —–BEGIN OPENSSH PRIVATE KEY—–

You can check if you’ve an OpenSSH private key in PowerShell with Get-Content cmdlet.

Get-Content D:\SSH\openssh-privkey
-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABFwAAAAdz
c2gtcnNhAAAAAwEAAQAAAQEA3kQeE0v2hu7gdv0FNWrlYoGel4oPkoE0L6wPPTFc
...
-----END OPENSSH PRIVATE KEY-----

1. Open PowerShell as administrator then create a folder named .ssh in the home directory of the current logon user.

New-Item ~/.ssh -Type Directory

2. Copy the OpenSSH private key to that folder then rename it. The RSA private key stores in PEM format (.pem).

Note Note: Don't for get to change the admin by your username of the current logon user.
Copy-Item 'D:\SSH\openssh-privkey' 'C:\Users\admin\.ssh\rsa-privkey.pem'

3. Now, run the below command to convert OpenSSH private key to RSA private key.

ssh-keygen -p -m PEM -f 'C:\Users\admin\.ssh\rsa-privkey.pem'

If you want to protect your private key by a pass phrase, type it when prompted. In our case, we just press Enter to continue without adding the pass phrase.

Enter new passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved with the new passphrase.

4. The OpenSSH private key is converted to RSA private key. You can check it using the Get-Content cmdlet.

Get-Content 'C:\Users\admin\.ssh\rsa-privkey.pem'
-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEA3kQeE0v2hu7gdv0FNWrlYoGel4oPkoE0L6wPPTFcNGpp+EaG
8JqOQEDSjNEZl0xZcNtQHq0Q1EsOjYq6P3ZMnRuawTt9+Rpz88ZFB0NG+zJ4xqoU
...
-----END RSA PRIVATE KEY-----

Using an OpenSSH client, we can use both of private key types to SSH to the remote Linux system with key-based authentication.

 ssh [email protected] -i ~\.ssh\openssh-privkey
ssh [email protected] -i ~\.ssh\rsa-privkey.pem
ibOPXRpZfQxXVKTnz3s3BcDA6uy3B9LupJcc5JPwgbDXMGEbQKpoLOVHqiVN

Using the PuTTY Key Generator

Alternatively, we can use the PuTTY Key Generator to convert RSA private key to OpenSSH private key. Download the PuTTYGen from the official site then open it.

  • PuTTYGen: https://the.earth.li/~sgtatham/putty/latest/w64/puttygen.exe

1. In the PuTTYGen, navigate to File → Load private key.

BuGCrP4FVDTUgtTkzvH90OKgJuUybBdgC53PTuxR3Y69aXFVetvMuM0VjiUE

2. Load the OpenSSH private key. If you cannot see the key in the folder, change the file type to All Files.

crBuBAFTPqjFAzHevNRAylPB3K82gLSdUeLXManxj4NwVpfTm5zLrIvCQs1O

3. Click OK to continue.

xk1ZgEXOSvtWeOPly4zWdJo36ZZcFuS3tPgaEymHL70tWba7a2TKl8SUcQnv

4. Now, navigate to Conversions → Export OpenSSH key

yGw3xug1X8SJW7plrWk1xgrrtSfeFVrYvEhZlJe6qHbkKgQOtttPTTNppnSU

5. Enter a desire name with .pem extension.

XLbJJ1y1UOAjP5ZjjaLngQGyvvgr4FOrOziSLsUYQBKWTySvQYHvLRxE4jyt

Finally, open the converted file using any text editor to verify it works. The file should begin with —–BEGIN RSA PRIVATE KEY—–

DzmW5hszqhSAjFI8dZQo5E34FslQ8pVsqUY5JqWgRSarscYOnuyixZjwfRpi
ADVERTISEMENT

Not a reader? Watch this related video tutorial:

5/5 - (1 vote)
Previous Post

How to Fix WARNING UNPROTECTED PRIVATE KEY FILE With OpenSSH

Next Post

How to Convert RSA Private Key to OpenSSH Private Key

Related Posts

Images Hidden Due To Mature Content Settings In CivitAI

August 31, 2024

Azure OpenAI vs Azure AI Hub, How to Choose the Right One for Your Needs

August 20, 2024

Running Hyper-V and VMware Workstation on The Same Machine

August 15, 2024

How to Uninstall All Autodesk Products At Once Silently

July 29, 2024
Ftr5

How to Uninstall the Autodesk Genuine Service on Windows

July 29, 2024

How to Remove The Test Mode Watermark Without Disabling Test Mode

July 28, 2024

Leave a Reply Cancel reply

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

Recent Posts

  • How To Turn On uBlock Origin Extension in Chrome (2025)
  • Images Hidden Due To Mature Content Settings In CivitAI
  • Azure OpenAI vs Azure AI Hub, How to Choose the Right One for Your Needs

Categories

Stay in Touch

Discord Server

Join the Discord server with the site members for all questions and discussions.

Telegram Community

Jump in Telegram server. Ask questions and discuss everything with the site members.

Youtube Channel

Watch more videos, learning and sharing with Leo ❤❤❤. Sharing to be better.

Newsletter

Join the movement and receive our weekly Tech related newsletter. It’s Free.

General

Microsoft Windows

Microsoft Office

VMware

VirtualBox

Technology

PowerShell

Microsoft 365

Microsoft Teams

Email Servers

Copyright 2025 © All rights Reserved. Design by Leo with ❤

No Result
View All Result
  • Home
  • Linux
  • Intune
  • macOS
  • VMware
  • VirtualBox
  • Powershell
  • Windows 10
  • Windows 11
  • Microsoft 365
  • Microsoft Azure
  • Microsoft Office
  • Active Directory

No Result
View All Result
  • Home
  • Linux
  • Intune
  • macOS
  • VMware
  • VirtualBox
  • Powershell
  • Windows 10
  • Windows 11
  • Microsoft 365
  • Microsoft Azure
  • Microsoft Office
  • Active Directory