1

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

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: whatever some version
Comment: xy

AAAB3NzaC1yc2EAAAABJQAAAQEAr6tGCOUwhkSWsgm5Z4Fq2KkoqcCvk0MPGxuzudQ2v4DjCi382G
... ... ...
z30VpGiMr8qrnF7iApEjNLrcMCRAYHOKC/0DuyYXH60aLyBfmLa5hMsiP3qKvkayAuL=
=1T3F
-----END PGP PUBLIC KEY BLOCK-----

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

ssh-rsa 
AAAAB3NzaC1yc2EAAAABJQAAAQEAr6tGCOUwhkSWsgm5Z4Fq2KkoqcCvk0MPGxuzudQ2v4DjCi382
Gz30VpGiMr8qrnF7iApEjNLrcMCRAYHOKC/0DuyYXH60aLyBfmLa5hMsiP3qKvkayAuL+SHrja6h/OpWAtom2bcnqLMqIFypP/fruYn4xHKIuTjiAtu5
/cgK90BamQQlf9GRxeTBEcSVNMBUdwJEAtJ9O7LOnco4riRH699mdHqouQljMjMOFVTQ2pqCmC2fA6/VvpRBrznKToGRSxj
/yCeLqoB6nAvPHleNGixGhYk+OkJNMPRRRFqvnP52baObD9+50Jaid4+odhwCgmpyOZt1XZ4NW+ks
7ldgQ== rsa-key-20180109

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

1 Answer 1

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.

4
  • 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
    Commented 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
    Commented Jan 9, 2018 at 21:02
  • @crasic so if one key gets compromised, it affects everything - email, files, ssh hosts, etc. Commented Jan 9, 2018 at 21:03
  • Yes, that is a consequence of using one secret.
    – crasic
    Commented 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.