man-puttygen.but 12 KB

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