I know a bit about computer security, and well as about the concept of public and private keys. I also know that both GPG and (Open)SSH use the public/private key system. My question is, is there any reason that I would not want to use my GPG keys as authentication for SSH?

Please note that, while a have a little bit more experience with Linux, GPG, and SSH than the average computer user, I am by no means an expert. Please be patient and point out any mistakes that you might see.


No, it wouldn't. To put things simply, GPG and SSH do not use the same key format, which is a practical hurdle right from the start. Furthermore, the two key pairs might not have the same validity — you might want to repudiate one and not the other, or to have different SSH keys on different accounts but the same GPG key everywhere.

There's nothing to be gained by using the same key anyway. You'd have to convert the GPG key into an SSH key (assuming your GPG key is an RSA key in the first place!). At this point, you might as well generate a different key, since no tool is going to check one against the other.

  • What are some of the differences between the key formats? Do the different formats employ different algorithms for generating public/private pairs? Does this have anything to do with RSA and DSA, which I repeatedly hear about? – fouric Oct 25 '12 at 4:25
  • 1
    @InkBlend Both SSH and GPG support multiple key types, yes. See the ssh-keygen for the key types supported by SSH and the GPG handbook for the key types supported by GPG. – Gilles 'SO- stop being evil' Oct 25 '12 at 9:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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