I want to use public/private key act for logging in to my raspberry pi. I have an existing public key (GnuPG), can i also use this one, or do i have to use putty keys (.ppk) for this? If this is possible, what from my public key has to be copied into authorized_keys? Because my public key is build like this

Version: whatever some version
Comment: xy

... ... ...

and the key in a .ppk file generated with putty looks like this

7ldgQ== rsa-key-20180109

Do i also have to put the header "begin" and "end public key block" into the file?

1 Answer 1


You cannot use PGP/GPG keys with ssh directly. Generally, PGP/GPG keys are used for signing, encrypting, and decrypting texts, e-mails, files, directories, and whole disk partitions and to increase the security of e-mail communications.

You need to use ssh keys to use with OpenSSH. You can use Puttykeygen (windows) or ssh-keygen (Linux) to generate ssh specific keys. You can put the public key on the target ssh server host and keep the private key on the ssh client host.

  • 1
    This is simply not true, you can use the same underlying key that has been converted, you cannot use the same file, but you can use the same keys in both systems with conversion (i.e. - one secret) - see security.stackexchange.com/questions/9633/…
    – crasic
    Jan 9, 2018 at 20:51
  • Practicality is a property of the requirements, no? If you have existing key infrastructure it is very practical to reuse the same keys without constructing another trust network, practical enough that someone has written and maintained a tool to do this for almost 10 years.
    – crasic
    Jan 9, 2018 at 21:02
  • @crasic so if one key gets compromised, it affects everything - email, files, ssh hosts, etc. Jan 9, 2018 at 21:03
  • Yes, that is a consequence of using one secret.
    – crasic
    Jan 9, 2018 at 21:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.