Generating RSA private key from PGP PRIVATE KEY BLOCK

pgpssh

I downloaded my private key block from keybase.io (into file keybase.ppk). It starts with:

-----BEGIN PGP PRIVATE KEY BLOCK-----
Version: Keybase OpenPGP v2.0.49

I would now like to create a ssh key pair so I can put a public key on a remote server and use the private key to log into it. How do I do it on Linux?

I tried various methods I found on the net and all I learned is that my understanding of applications and standards in contemporary cryptography is very limited :-/

Best Answer

After some more googling I finally understood what this answer means:

https://security.stackexchange.com/a/9635

What needs to be done beforehand for this answer to work out is:

gpg --import .ssh/keybase.ppk

After that, I did:

gpg --edit-key D937A057 # removing password
gpg --export D937A057 | openpgp2ssh D937A057 > keybase.pub # generating public key
gpg --export-secret-key D937A057 | openpgp2ssh D937A057 > keybase # generating private key
gpg --delete-secret-key D937A057 # cleanup

One would think there's an easier way to do this. Spent solid 2 hours to figure this out...