man-puttygen.but 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412
  1. \cfg{man-identity}{puttygen}{1}{2004-03-24}{PuTTY tool suite}{PuTTY tool suite}
  2. \H{puttygen-manpage} Man page for PuTTYgen
  3. \S{puttygen-manpage-name} NAME
  4. \cw{puttygen} - public-key generator for the PuTTY tools
  5. \S{puttygen-manpage-synopsis} SYNOPSIS
  6. \c puttygen ( keyfile | -t keytype [ -b bits ] [ --primes method ] [ -q ] )
  7. \e bbbbbbbb iiiiiii bb iiiiiii bb iiii bbbbbbbb iiiiii bb
  8. \c [ -C new-comment ] [ -P ] [ --reencrypt ]
  9. \e bb iiiiiiiiiii bb bbbbbbbbbbb
  10. \c [ --certificate cert-file | --remove-certificate ]
  11. \e bbbbbbbbbbbbb iiiiiiiii bbbbbbbbbbbbbbbbbbbb
  12. \c [ -O output-type | -l | -L | -p | --dump | --cert-info ]
  13. \e bb iiiiiiiiiii bb bb bb bbbbbb bbbbbbbbbbb
  14. \c [ --ppk-param key=value,... | -E fptype ]
  15. \e bbbbbbbbbbb iiibiiiiib bb iiiiii
  16. \c [ -o output-file ]
  17. \e bb iiiiiiiiiii
  18. \S{puttygen-manpage-description} DESCRIPTION
  19. \c{puttygen} is a tool to generate and manipulate SSH public and
  20. private key pairs. It is part of the PuTTY suite, although it can
  21. also interoperate with the key formats used by some other SSH clients.
  22. When you run \c{puttygen}, it does three things. Firstly, it either
  23. loads an existing key file (if you specified \e{keyfile}), or
  24. generates a new key (if you specified \e{keytype}). Then, it
  25. optionally makes modifications to the key (such as changing the comment
  26. and/or the passphrase); finally, it outputs the key, or some
  27. information about the key, to a file.
  28. All three of these phases are controlled by the options described in
  29. the following section.
  30. \S{puttygen-manpage-options} OPTIONS
  31. In the first phase, \c{puttygen} either loads or generates a key.
  32. Note that generating a key requires random data, which can cause
  33. \c{puttygen} to pause, possibly for some time if your system does
  34. not have much randomness available.
  35. The options to control this phase are:
  36. \dt \e{keyfile}
  37. \dd Specify a key file to be loaded. (Use \cq{-} to read a key
  38. file from standard input.)
  39. \lcont{
  40. Usually this will be a private key, which can be in the (de facto
  41. standard) SSH-1 key format, or in PuTTY's SSH-2 key format, or in
  42. either of the SSH-2 private key formats used by OpenSSH and
  43. ssh.com's implementation.
  44. You can also specify a file containing only a \e{public} key here.
  45. The operations you can do are limited to outputting another public
  46. key format (possibly removing an attached certificate first), or a
  47. fingerprint. Public keys can be in RFC 4716 or OpenSSH format, or
  48. the standard SSH-1 format.
  49. }
  50. \dt \cw{\-t} \e{keytype}
  51. \dd Specify a type of key to generate. The acceptable values here are
  52. \c{rsa}, \c{dsa}, \c{ecdsa}, \c{eddsa}, \c{ed25519}, and \c{ed448}
  53. (to generate SSH-2 keys), and \c{rsa1} (to generate SSH-1 keys).
  54. \dt \cw{\-b} \e{bits}
  55. \dd Specify the size of the key to generate, in bits. Default for
  56. \c{rsa} and \c{dsa} keys is 2048.
  57. \dt \cw{\-\-primes} \e{method}
  58. \dd Method for generating prime numbers. The acceptable values here
  59. are \c{probable} (the default), \c{proven}, and \c{proven-even};
  60. the later methods are slower. (Various synonyms for these method
  61. names are also accepted.)
  62. \lcont{
  63. The \q{probable primes} method sounds unsafe, but it's the most
  64. commonly used prime-generation strategy. There is in theory a
  65. possibility that it might accidentally generate a number that isn't
  66. prime, but the software does enough checking to make that probability
  67. vanishingly small (less than 1 in 2^80, or 1 in 10^24). So, in
  68. practice, nobody worries about it very much.
  69. The other methods cause PuTTYgen to use numbers that it is \e{sure}
  70. are prime, because it generates the output number together with a
  71. proof of its primality. This takes more effort, but it eliminates that
  72. theoretical risk in the probabilistic method.
  73. You might choose to switch from probable to proven primes if you have
  74. a local security standard that demands it, or if you don't trust the
  75. probabilistic argument for the safety of the usual method.
  76. }
  77. \dt \cw{\-\-strong-rsa}
  78. \dd When generating an RSA key, make sure the prime factors of the key
  79. modulus are \q{strong primes}. A strong prime is a prime number chosen
  80. to have a particular structure that makes certain factoring algorithms
  81. more difficult to apply, so some security standards recommend their
  82. use. However, the most modern factoring algorithms are unaffected, so
  83. this option is probably not worth turning on \e{unless} you have a
  84. local standard that recommends it.
  85. \dt \cw{\-q}
  86. \dd Suppress the progress display when generating a new key.
  87. \dt \cw{\-\-old\-passphrase} \e{file}
  88. \dd Specify a file name; the first line will be read from this file
  89. (removing any trailing newline) and used as the old passphrase.
  90. \s{CAUTION:} If the passphrase is important, the file should be stored
  91. on a temporary filesystem or else securely erased after use.
  92. \dt \cw{\-\-random\-device} \e{device}
  93. \dd Specify device to read entropy from. By default, \c{puttygen}
  94. uses \c{/dev/urandom}, falling back to \c{/dev/random} if it has to.
  95. In the second phase, \c{puttygen} optionally alters properties of
  96. the key it has loaded or generated. The options to control this are:
  97. \dt \cw{\-C} \e{new\-comment}
  98. \dd Specify a comment string to describe the key. This comment string
  99. will be used by PuTTY to identify the key to you (when asking you to
  100. enter the passphrase, for example, so that you know which passphrase
  101. to type).
  102. \dt \cw{\-P}
  103. \dd Indicate that you want to change the key's passphrase. This is
  104. automatic when you are generating a new key, but not when you are
  105. modifying an existing key.
  106. \dt \cw{\-\-certificate} \e{certificate-file}
  107. \dd Adds an OpenSSH-style certificate to the public half of the key,
  108. so that the output file contains a certified public key with the same
  109. private key. If the input file already contained a certificate, it
  110. will be replaced with the new one. (Use \cq{-} to read a certificate
  111. from standard input.)
  112. \dt \cw{\-\-remove\-certificate}
  113. \dd Removes any certificate that was part of the key, to recover the
  114. uncertified version of the underlying key.
  115. \dt \cw{\-\-reencrypt}
  116. \dd For an existing private key saved with a passphrase, refresh the
  117. encryption without changing the passphrase.
  118. \lcont{
  119. This is most likely to be useful with the \cw{\-\-ppk-param} option,
  120. to change some aspect of the key file's format or encryption.
  121. }
  122. \dt \cw{\-\-ppk-param} \e{key}\cw{=}\e{value}\cw{,}...
  123. \dd When saving a PPK file (the default \cw{private} output type for SSH-2
  124. keys), adjust details of the on-disk format.
  125. \lcont{
  126. Aspects to change are specified as a series of \e{key}\cw{=}\e{value} pairs
  127. separated by commas. The \e{key}s are:
  128. \dt \cw{version}
  129. \dd The PPK format version. Possible values are \cw{3} (the default)
  130. and \cw{2} (which is less resistant to brute-force decryption, but
  131. which you might need if your key needs to be used by old versions of
  132. PuTTY tools, or other PPK consumers).
  133. \lcont{
  134. The following \e{key}s only affect PPK version 3 files.
  135. }
  136. \dt \cw{kdf}
  137. \dd The variant of the Argon2 key derivation function to use. Options
  138. are \cw{argon2id} (default, and recommended), \cw{argon2i}, and
  139. \cw{argon2d}.
  140. \lcont{
  141. You might change this if you consider your exposure to side-channel
  142. attacks to be different to the norm.
  143. }
  144. \dt \cw{memory}
  145. \dd The amount of memory needed to decrypt the key, in Kbyte. Default
  146. is 8192 (i.e., 8 Mbyte).
  147. \dt \cw{time}
  148. \dd Approximate time, on this machine, required to attempt decrypting
  149. the key, in milliseconds. Default is 100 (ms).
  150. \dt \cw{passes}
  151. \dd Alternative to \cw{time}: explicitly specify the number of hash
  152. passes required to attempt decrypting the key.
  153. \dt \cw{parallelism}
  154. \dd Number of parallelisable threads that can be used to decrypt the
  155. key. Default is 1 (force decryption to run single-threaded).
  156. }
  157. In the third phase, \c{puttygen} saves the key or information
  158. about it. The options to control this are:
  159. \dt \cw{\-O} \e{output\-type}
  160. \dd Specify the type of output you want \c{puttygen} to produce.
  161. Acceptable options are:
  162. \lcont{
  163. \dt \cw{private}
  164. \dd Save the private key in a format usable by PuTTY. This will either
  165. be the standard SSH-1 key format, or PuTTY's own SSH-2 key format
  166. (\q{PPK}). This is the default.
  167. \dt \cw{public}
  168. \dd Save the public key only. For SSH-1 keys, the standard public key
  169. format will be used (\q{\cw{1024 37 5698745}...}). For SSH-2 keys, the
  170. public key will be output in the format specified by RFC 4716,
  171. which is a multi-line text file beginning with the line
  172. \q{\cw{---- BEGIN SSH2 PUBLIC KEY ----}}.
  173. \dt \cw{public-openssh}
  174. \dd Save the public key only, in a format usable by OpenSSH. For SSH-1
  175. keys, this output format behaves identically to \c{public}. For
  176. SSH-2 keys, the public key will be output in the OpenSSH format,
  177. which is a single line (\q{\cw{ssh-rsa AAAAB3NzaC1yc2}...}).
  178. \dt \cw{fingerprint}
  179. \dd Print a fingerprint of the public key. The \cw{-E} option lets you
  180. specify which fingerprinting algorithm to use. All algorithms are
  181. believed compatible with OpenSSH.
  182. \dt \cw{private-openssh}
  183. \dd Save an SSH-2 private key in OpenSSH's format, using the oldest
  184. format available to maximise backward compatibility. This option is not
  185. permitted for SSH-1 keys.
  186. \dt \cw{private-openssh-new}
  187. \dd As \c{private-openssh}, except that it forces the use of OpenSSH's
  188. newer format even for RSA, DSA, and ECDSA keys.
  189. \dt \cw{private-sshcom}
  190. \dd Save an SSH-2 private key in ssh.com's format. This option is not
  191. permitted for SSH-1 keys.
  192. \dt \cw{cert-info}
  193. \dd Save a textual dump of information about the certificate on the
  194. key, if any: whether it's a host or a user certificate, what host(s)
  195. or user(s) it's certified to be, its validity period, ID and serial
  196. number, and the fingerprint of the signing CA.
  197. \dt \cw{text}
  198. \dd Save a textual dump of the numeric components comprising the key
  199. (both the public and private parts, if present). Useful for debugging,
  200. or for using PuTTYgen as a key generator for applications other than
  201. SSH.
  202. \lcont{
  203. The output consists of a series of \cw{name=value} lines, where each
  204. \c{value} is either a C-like string literal in double quotes, a
  205. hexadecimal number starting with \cw{0x...}, or a binary blob
  206. encoded with base64, denoted by \cw{b64("...")}.
  207. }
  208. If no output type is specified, the default is \c{private}.
  209. }
  210. \dt \cw{\-o} \e{output\-file}
  211. \dd Specify the file where \c{puttygen} should write its output. If
  212. this option is not specified, \c{puttygen} will assume you want to
  213. overwrite the original file if the input and output file types are
  214. the same (changing a comment or passphrase), and will assume you
  215. want to output to stdout if you are asking for a public key,
  216. fingerprint, or one of the textual dump types. Otherwise, the
  217. \c{\-o} option is required.
  218. \dt \cw{\-l}
  219. \dd Synonym for \q{\cw{-O fingerprint}}.
  220. \dt \cw{\-L}
  221. \dd Synonym for \q{\cw{-O public-openssh}}.
  222. \dt \cw{\-p}
  223. \dd Synonym for \q{\cw{-O public}}.
  224. \dt \cw{\-\-cert\-info}
  225. \dd Synonym for \q{\cw{-O cert-info}}.
  226. \dt \cw{\-\-dump}
  227. \dd Synonym for \q{\cw{-O text}}.
  228. \dt \cw{-E} \e{fptype}
  229. \dd Specify the algorithm to use if generating a fingerprint. The
  230. available algorithms are are \cw{sha256} (the default) and \cw{md5}.
  231. \lcont{
  232. By default, when showing the fingerprint of a public key that includes
  233. a certificate, \c{puttygen} will not include the certificate, so that
  234. the fingerprint shown will be the same as the underlying public key.
  235. If you want the fingerprint including the certificate (for example, so
  236. as to tell two certified keys apart), you can specify \cw{sha256-cert}
  237. or \cw{md5-cert} as the fingerprint type.
  238. }
  239. \dt \cw{\-\-new\-passphrase} \e{file}
  240. \dd Specify a file name; the first line will be read from this file
  241. (removing any trailing newline) and used as the new passphrase. If the
  242. file is empty then the saved key will be unencrypted. \s{CAUTION:} If
  243. the passphrase is important, the file should be stored on a temporary
  244. filesystem or else securely erased after use.
  245. The following options do not run PuTTYgen as normal, but print
  246. informational messages and then quit:
  247. \dt \cw{\-h}, \cw{\-\-help}
  248. \dd Display a message summarizing the available options.
  249. \dt \cw{\-V}, \cw{\-\-version}
  250. \dd Display the version of PuTTYgen.
  251. \dt \cw{\-\-pgpfp}
  252. \dd Display the fingerprints of the PuTTY PGP Master Keys, to aid
  253. in verifying new files released by the PuTTY team.
  254. \S{puttygen-manpage-examples} EXAMPLES
  255. To generate an SSH-2 RSA key pair and save it in PuTTY's own format
  256. (you will be prompted for the passphrase):
  257. \c puttygen -t rsa -C "my home key" -o mykey.ppk
  258. To generate a larger (4096-bit) key:
  259. \c puttygen -t rsa -b 4096 -C "my home key" -o mykey.ppk
  260. To change the passphrase on a key (you will be prompted for the old
  261. and new passphrases):
  262. \c puttygen -P mykey.ppk
  263. To change the comment on a key:
  264. \c puttygen -C "new comment" mykey.ppk
  265. To convert a key into OpenSSH's private key format:
  266. \c puttygen mykey.ppk -O private-openssh -o my-openssh-key
  267. To convert a key \e{from} another format (\c{puttygen} will
  268. automatically detect the input key type):
  269. \c puttygen my-ssh.com-key -o mykey.ppk
  270. To display the SHA-256 fingerprint of a key (some key types require a
  271. passphrase to extract even this much information):
  272. \c puttygen -l mykey.ppk
  273. To add the OpenSSH-format public half of a key to your authorised
  274. keys file:
  275. \c puttygen -L mykey.ppk >> $HOME/.ssh/authorized_keys