Skip to content

Instantly share code, notes, and snippets.

@GabLeRoux
Created Jul 31, 2019
Embed
What would you like to do?
Convert OPENSSH to RSA from command line

Convert openssh keys to rsa keys

from something that starts with

-----BEGIN OPENSSH PRIVATE KEY-----

to something that starts with

-----BEGIN RSA PRIVATE KEY-----

🎉

#!/usr/bin/env bash
set -e
set -x
original_key=$1
puttygen_destinaton=${original_key}_puttygen
rsa_destinaton=${original_key}_rsa
# FROM OPENSSH to SSH2 ENCRYPTED
puttygen $original_key -O private-sshcom -o $puttygen_destinaton
# FROM SSH2 ENCRYPTED format to RSA
ssh-keygen -i -f $puttygen_destinaton > $rsa_destinaton
@jim-binxhealth
Copy link

It worked! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment