Puttygen Examples

Create key

puttygen -t rsa -b 2048 -C "commenct for that key" -o putty-private-keyfile.ppk

Extract the public key

puttygen -L putty-private-keyfile.ppk
ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAgEAiUG9w5O6MTK/U2J/23ledKqxaYuVTVt5eRXehWvNyF5BOT2/XURROx7bkj88CvGGPdkXcLf/stNXKe3M5UBtNffZ3bBylr+xb1bjVb9kIcVaQ3d5WqfP/2Ewf5OqMgJuykeAtBbcssddddhgDU7XxBq/AXrTc3NODNHtMDW73uD7pjaWTYXVIFftBdvM8HkO3UFjl7PtOZQm1XNGgAuLnKLIY1zTDKapPIod7rUOVRwDOhZimXdibAdddddNpEFIO9zL2+cdAgLKPJbuYyQfdsdafasYDP66/xbhUXwLrmKXATGDEXnR84SgzT48Qn31EwrTWmx+Vuj3qDDhUhQ2OAxXYpjc/Q2nUJKHqJn6ePTxO3IJHX1Ge7NfHtHaeNdPJqHIwjziaJhrvXTXbKNurQ3dKltgTKgGMWAn59XMSWMMpbhZmBjDv1/9pdgNO+FyEE2YamfWZXKzroEUmJIO/GONTU9X2X9DVXKjGdsafd1K3KAZ9yOGEXq+F8gWOdC6NnllqbGkCUQWvCvTkQHvbkuqNOdj5g0YEi2VyKmAyy9l6CTupQlqrAahoeMxvLO+WTl4MFa+p3HE8= example key

Export OpenSSH Key

puttygen putty-private-keyfile.ppk -O private-openssh -o openssh-private-keyfile

-O options

-O output-type = specifies what to output. By default, the private key is output.

  • private = save the private key in the proprietary PuTTY key format as a .ppk file.
  • fingerprint (or -l) = outputs the fingerprint of the key
  • public (or -p) = save the public key corresponding to the private key. For SSH2 keys, the public key will be output in the format specified by RFC 4716. This format is supported by, e.g., Tectia SSH. Keys in that format look like this:

—- BEGIN SSH2 PUBLIC KEY —- Comment: “user@example.com” AAAAB3NzaC1yc2EAAAABIwAsdfasdfEA1on8gxCGJJWSRT4uOrR13mUaUk0hRf4RzxSZ1zRb YYFw8pfGesIFoEuVth4HKyF8k1y4mRUafdssdfasdfe4WWZSXXcPff+EHtWshahu3WzBdnGxm5Xoi89zcE=
—- END SSH2 PUBLIC KEY —-

  • public-openssh (or -L) = save the public key only, in OpenSSH's proprietary format. The format is also supported by Tectia SSH. like this:
  ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTbmdsfawer23lzdHAyNTYAAABBBN+Mh3U/3We4VYtV1QmWUFIzFLTUe32324D/QGtCRGAZn8bxX9KlCrrWISIjSYAwCajIEGSPEZwPNMBoK8XD8Q= test@example.com
  • private-openssh = converts the private key to OpenSSH's format. This can only be used for SSH2 keys.
  • private-sshcom = converts the private key to the format used by Tectia SSH.
  • private-openssh = coverts the private key to the format used by OpenSSH. This format is also supported by Tectia SSH.


Authors:
  • Jochen Schnuerle