summaryrefslogtreecommitdiff
path: root/man/man1/openpgp2ssh.1
blob: 1a02b3819393f386a17ae54392261670e8ecaa19 (plain)
  1. .\"  -*- nroff -*-
  2. .Dd $Mdocdate: June 11, 2008 $
  3. .Dt OPENPGP2SSH 1
  4. .Os
  5. .Sh NAME
  6. openpgp2ssh
  7. .Nd translate OpenPGP keys to SSH keys
  8. .Sh SYNOPSIS
  9. .Nm openpgp2ssh < mykey.gpg
  10. .Nm gpg --export $KEYID | openpgp2ssh $KEYID
  11. .Nm gpg --export-secret-key $KEYID | openpgp2ssh $KEYID
  12. .Sh DESCRIPTION
  13. openpgp2ssh takes an OpenPGP-formatted primary key and associated
  14. subkeys on standard input, and spits out the requested equivalent
  15. SSH-style key on standard output.
  16. If the data on standard input contains no subkeys, you can invoke
  17. openpgp2ssh without arguments. If the data on standard input contains
  18. multiple keys (e.g. a primary key and associated subkeys), you must
  19. specify a specific OpenPGP keyid (e.g. CCD2ED94D21739E9) or
  20. fingerprint as the first argument to indicate which key to export.
  21. The keyid must be exactly 16 hex characters.
  22. If the input contains an OpenPGP RSA or DSA public key, it will be
  23. converted to the OpenSSH-style single-line keystring, prefixed with
  24. the key type. This format is suitable (with minor alterations) for
  25. insertion into known_hosts files and authorized_keys files.
  26. If the input contains an OpenPGP RSA or DSA secret key, it will be
  27. converted to the equivalent PEM-encoded private key.
  28. openpgp2ssh is part of the
  29. .Xr monkeysphere 1
  30. framework for providing a PKI for SSH.
  31. .Sh CAVEATS
  32. The keys produced by this process are stripped of all identifying
  33. information, including certifications, self-signatures, etc. This is
  34. intentional, since ssh attaches no inherent significance to these
  35. features.
  36. openpgp2ssh only works with RSA or DSA keys, because those are the
  37. only ones which work with ssh.
  38. Assuming a valid key type, though, openpgp2ssh will produce output for
  39. any requested key. This means, among other things, that it will
  40. happily export revoked keys, unverifiable keys, expired keys, etc.
  41. Make sure you do your own key validation before using this tool!
  42. .Sh EXAMPLES
  43. .Nm gpg --export-secret-key $KEYID | openpgp2ssh $KEYID | ssh-add -c /dev/stdin
  44. This pushes the secret key into the active
  45. .Xr ssh-agent 1 .
  46. Tools such as
  47. .Xr ssh 1
  48. which know how to talk to the
  49. .Xr ssh-agent 1
  50. can now rely on the key.
  51. .Sh AUTHOR
  52. openpgp2ssh and this man page were written by Daniel Kahn Gillmor
  53. <dkg@fifthhorseman.net>.
  54. .Sh BUGS
  55. openpgp2ssh currently only exports into formats used by the OpenSSH.
  56. It should support other key output formats, such as those used by
  57. lsh(1) and putty(1).
  58. Secret key output is currently not passphrase-protected.
  59. openpgp2ssh currently cannot handle passphrase-protected secret keys on input.
  60. It would be nice to be able to use keyids shorter or longer than 16
  61. hex characters.
  62. openpgp2ssh only acts on keys associated with the first primary key
  63. passed in. If you send it more than one primary key, it will silently
  64. ignore later ones.
  65. .Sh SEE ALSO
  66. .Xr monkeysphere 1 ,
  67. .Xr ssh 1 ,
  68. .Xr monkeysphere-server 8