man-pageant.but 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432
  1. \cfg{man-identity}{pageant}{1}{2015-05-19}{PuTTY tool suite}{PuTTY tool suite}
  2. \H{pageant-manpage} Man page for Pageant
  3. \S{pageant-manpage-name} NAME
  4. \cw{pageant} - PuTTY SSH authentication agent
  5. \S{pageant-manpage-synopsis} SYNOPSIS
  6. \c pageant ( -X | -T | --permanent | --debug ) [ [ --encrypted ] key-file... ]
  7. \e bbbbbbb bb bb bbbbbbbbbbb bbbbbbb bbbbbbbbbbb iiiiiiii
  8. \c pageant [ [ --encrypted ] key-file... ] --exec command [ args... ]
  9. \e bbbbbbb bbbbbbbbb iiiiiiii bbbbbb iiiiiii iiii
  10. \c pageant -a [ --encrypted ] key-file...
  11. \e bbbbbbb bb bbbbbbbbbbb iiiiiiii
  12. \c pageant ( -d | -r | --public | --public-openssh ) key-identifier...
  13. \e bbbbbbb bb bb bbbbbbbb bbbbbbbbbbbbbbbb iiiiiiiiiiiiii
  14. \c pageant ( -D | -R )
  15. \e bbbbbbb bb bb
  16. \c pageant -l [ --fptype format ]
  17. \e bbbbbbb bb bbbbbbbb iiiiii
  18. \c pageant --askpass prompt
  19. \e bbbbbbb bbbbbbbbb iiiiii
  20. \S{pageant-manpage-description} DESCRIPTION
  21. \c{pageant} is both an SSH authentication agent, and also a tool for
  22. communicating with an already-running agent.
  23. When running as an SSH agent, it listens on a Unix-domain socket for
  24. connections from client processes running under your user id. Clients
  25. can load SSH private keys into the agent, or request signatures on a
  26. given message from a key already in the agent. This permits one-touch
  27. authentication by SSH client programs, if Pageant is holding a key
  28. that the server they are connecting to will accept.
  29. \c{pageant} can also act as a client program itself, communicating
  30. with an already-running agent to add or remove keys, list the keys, or
  31. extract their public half.
  32. The agent protocol used by \c{pageant} is compatible with the PuTTY
  33. tools and also with other implementations such as OpenSSH's SSH client
  34. and \cw{ssh-agent}(\e{1}). Some \c{pageant} features are implemented with
  35. protocol extensions, so will only work if \c{pageant} is on both ends.
  36. To run \c{pageant} as an agent, you must provide an option to tell it
  37. what its \e{lifetime} should be. Typically you would probably want
  38. Pageant to last for the duration of a login session, in which case you
  39. should use either \cw{-X} or \cw{-T}, depending on whether your login
  40. session is GUI or purely terminal-based respectively. For example, in
  41. your X session startup script you might write
  42. \c eval $(pageant -X)
  43. \e bbbbbbbbbbbbbbbbbb
  44. which will cause Pageant to start running, monitor the X server to
  45. notice when your session terminates (and then it will terminate too),
  46. and print on standard output some shell commands to set environment
  47. variables that client processes will need to find the running agent.
  48. In a terminal-based login, you could do almost exactly the same thing
  49. but with \cw{-T}:
  50. \c eval $(pageant -T)
  51. \e bbbbbbbbbbbbbbbbbb
  52. This will cause Pageant to tie its lifetime to that of your
  53. controlling terminal: when you log out, and the terminal device ceases
  54. to be associated with your session, Pageant will notice that it has no
  55. controlling terminal any more, and will terminate automatically.
  56. In either of these modes, you can also add one or more private keys as
  57. extra command-line arguments, e.g.
  58. \c eval $(pageant -T ~/.ssh/key.ppk)
  59. \e bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
  60. in which case Pageant will immediately prompt for the keys' passphrases
  61. (if any) and start the agent with those keys already loaded in
  62. cleartext form. Passphrase prompts will use the controlling terminal if
  63. one is available, or failing that the GUI if one of those is available.
  64. (The prompt method can be overridden with the \cw{--gui-prompt} or
  65. \cw{--tty-prompt} options.) If neither is available, no passphrase
  66. prompting can be done.
  67. Alternatively, you can start an agent with keys stored in encrypted
  68. form:
  69. \c eval $(pageant -T --encrypted ~/.ssh/key.ppk)
  70. \e bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
  71. In this case, Pageant will not prompt for a passphrase at startup;
  72. instead, it will prompt the first time a client tries to use the key.
  73. (Pageant will need access to a GUI so that it can pop up a passphrase
  74. prompt when required, unless it's running in \cw{--debug} mode.)
  75. To use Pageant to talk to an existing agent, you can add new keys
  76. using \cw{-a}, list the current set of keys' fingerprints and comments
  77. with \cw{-l}, extract the full public half of any key using
  78. \cw{--public} or \cw{--public-openssh}, delete a specific key or
  79. all keys using \cw{-d} or \cw{-D} respectively, or request
  80. re-encryption of a specific key or all keys using \cw{-r} or \cw{-R}
  81. respectively.
  82. \S{pageant-manpage-lifetime} LIFETIME
  83. The following options are called \e{lifetime modes}. They all request
  84. Pageant to operate in agent mode; each one specifies a different
  85. method for Pageant to start up and know when to shut down.
  86. \dt \cw{-X}
  87. \dd Pageant will open a connection to your X display, and when that
  88. connection is lost, it will terminate. This gives it the same lifetime
  89. as your GUI login session, so in this mode it is suitable for running
  90. from a startup script such as \cw{.xsession}. The actual agent will be
  91. a subprocess; the main Pageant process will terminate immediately,
  92. after printing environment-variable setting commands on standard
  93. output which should be installed in any process wanting to communicate
  94. with the agent.
  95. \lcont{
  96. The usual approach would be to run
  97. \c eval $(pageant -X)
  98. \e bbbbbbbbbbbbbbbbbb
  99. in an X session startup script. However, other possibilities exist,
  100. such as directing the standard output of \cq{pageant -X} to a file
  101. which is then sourced by any new shell.
  102. }
  103. \dt \cw{-T}
  104. \dd Pageant will tie its lifetime to that of the login session running
  105. on its controlling terminal, by noticing when it ceases to have a
  106. controlling terminal (which will automatically happen as a side effect
  107. of the session leader process terminating). Like \cw{-X}, Pageant will
  108. print environment-variable commands on standard output.
  109. \dt \cw{--exec} \e{command}
  110. \dd Pageant will run the provided command as a subprocess, preloaded
  111. with the appropriate environment variables to access the agent it
  112. starts up. When the subprocess terminates, Pageant will terminate as
  113. well.
  114. \lcont{
  115. All arguments on Pageant's command line after \cw{--exec} will be
  116. treated as part of the command to run, even if they look like other
  117. valid Pageant options or key files.
  118. }
  119. \dt \cw{--permanent}
  120. \dd Pageant will fork off a subprocess to be the agent, and print
  121. environment-variable commands on standard output, like \cw{-X} and
  122. \cw{-T}. However, in this case, it will make no effort to limit its
  123. lifetime in any way; it will simply run permanently, unless manually
  124. killed. The environment variable \cw{SSH_AGENT_PID}, set by the
  125. commands printed by Pageant, permits the agent process to be found for
  126. this purpose.
  127. \lcont{
  128. This option is not recommended, because any method of manually killing
  129. the agent carries the risk of the session terminating unexpectedly
  130. before it manages to happen.
  131. }
  132. \dt \cw{--debug}
  133. \dd Pageant will run in the foreground, without forking. It will print
  134. its environment variable setup commands on standard output, and then it
  135. will log all agent activity to standard output as well; any passphrase
  136. prompts will need to be answered on standard input. This is useful
  137. for debugging what Pageant itself is doing, or what another process is
  138. doing to it.
  139. \S{pageant-manpage-client} CLIENT OPTIONS
  140. The following options tell Pageant to operate in client mode,
  141. contacting an existing agent via environment variables that it should
  142. already have set.
  143. \dt \cw{-a} \e{key-files}
  144. \dd Load the specified private key file(s) and add them to the
  145. already-running agent. Unless \cw{--encrypted} is also specified,
  146. \c{pageant} will decrypt them if necessary by prompting for their
  147. passphrases (with the same choice of user interfaces as in agent
  148. mode).
  149. \lcont{
  150. The private key files must be in PuTTY's \cw{.ppk} file format.
  151. }
  152. \dt \cw{-l}
  153. \dd List the keys currently in the running agent. Each key's
  154. fingerprint and comment string will be shown. (Use the \cw{-E}
  155. option to change the fingerprint format.)
  156. \lcont{
  157. Keys that will require a passphrase on their next use are listed as
  158. \q{encrypted}. Keys that can be returned to this state with \cw{-r}
  159. are listed as \q{re-encryptable}.
  160. }
  161. \dt \cw{--public} \e{key-identifiers}
  162. \dd Print the public half of each specified key, in the RFC 4716
  163. standard format (multiple lines, starting with \cq{---- BEGIN SSH2
  164. PUBLIC KEY ----}).
  165. \lcont{
  166. Each \e{key-identifier} can be any of the following:
  167. \b The name of a file containing the key, either the whole key (again
  168. in \cw{.ppk} format) or just its public half.
  169. \b The key's comment string, as shown by \cw{pageant -l}.
  170. \b Enough of one of the key's fingerprint formats to be unique among
  171. keys currently loaded into the agent.
  172. If Pageant can uniquely identify one key by interpreting the
  173. \e{key-identifier} in any of these ways, it will assume that key was
  174. the one you meant. If it cannot, you will have to specify more detail.
  175. If you find that your desired \e{key-identifier} string can be validly
  176. interpreted as more than one of the above \e{kinds} of identification,
  177. you can disambiguate by prefixing it as follows:
  178. \dt \cq{file:}
  179. \dd to indicate that it is a filename
  180. \dt \cq{comment:}
  181. \dd to indicate that it is a comment string
  182. \dt \cq{fp:}
  183. \dd to indicate that it is a fingerprint; any fingerprint format will
  184. be matched
  185. \dt \cq{sha256:} or \cq{md5:}
  186. \dd to indicate that it is a fingerprint of a specific format
  187. \dt \cq{sha256-cert:} or \cq{md5-cert:}
  188. \dd to indicate that it is a fingerprint of a specific format, and
  189. specifically matches the fingerprint of the public key \e{including} a
  190. certificate if any
  191. }
  192. \dt \cw{--public-openssh} \e{key-identifiers}, \cw{-L} \e{key-identifiers}
  193. \dd Print the public half of each specified key, in the one-line
  194. format used by OpenSSH, suitable for putting in
  195. \cw{.ssh/authorized_keys} files.
  196. \dt \cw{-d} \e{key-identifiers}
  197. \dd Delete each specified key from the agent's memory, so that the
  198. agent will no longer serve it to clients unless it is loaded in again
  199. using \cw{pageant -a}.
  200. \dt \cw{-D}
  201. \dd Delete all keys from the agent's memory, leaving it completely
  202. empty.
  203. \dt \cw{-r} \e{key-identifiers}
  204. \dd \q{Re-encrypt} each specified key in the agent's memory -
  205. that is, forget any cleartext version, so that the user will be
  206. prompted for a passphrase again next time the key is used.
  207. (For this to be possible, the key must previously have been added
  208. with the \cw{--encrypted} option.)
  209. \lcont{
  210. (Holding encrypted keys is a Pageant extension, so this option and
  211. \cw{-R} are unlikely to work with other agents.)
  212. }
  213. \dt \cw{-R}
  214. \dd \q{Re-encrypt} all possible keys in the agent's memory.
  215. (This may leave some keys in cleartext, if they were not previously
  216. added with the \cw{--encrypted} option.)
  217. \dt \cw{--test-sign} \e{key-identifier}
  218. \dt \cw{--test-sign-with-flags=}\e{flags} \e{key-identifier}
  219. \dd Sign arbitrary data with the given key. This mode is only likely
  220. to be useful when testing \c{pageant} itself.
  221. \lcont{
  222. The data to sign is taken from standard input, signed by the agent
  223. with the key identified by \e{key-identifier}, and the resulting
  224. signature emitted on standard output (as a binary blob in the format
  225. defined by the SSH specifications).
  226. \e{flags} is a number representing a combination of flag bits defined
  227. by the SSH agent protocol.
  228. }
  229. \S{pageant-manpage-askpass} SSH-ASKPASS REPLACEMENT
  230. \dt \cw{--askpass} \e{prompt}
  231. \dd With this option, \c{pageant} acts as an \cw{ssh-askpass}(\e{1})
  232. replacement, rather than performing any SSH agent functionality. This
  233. may be useful if you prefer Pageant's GUI prompt style, which
  234. minimises information leakage about your passphrase length in its
  235. visual feedback, compared to other \cw{ssh-askpass}(\e{1}) implementations.
  236. \lcont{
  237. \c{pageant --askpass} implements the standard \cw{ssh-askpass}(\e{1})
  238. interface: it can be passed a prompt to display (as a single argument)
  239. and, if successful, prints the passphrase on standard output and
  240. returns a zero exit status. Typically you would use the environment
  241. variable \cw{SSH_ASKPASS} to tell other programs to use \c{pageant} in
  242. this way.
  243. }
  244. \S{pageant-manpage-options} OPTIONS
  245. \dt \cw{-v}
  246. \dd Verbose mode. When Pageant runs in agent mode, this option causes
  247. it to log all agent activity to its standard error. For example, you
  248. might run
  249. \lcont{
  250. \c eval $(pageant -X -v 2>~/.pageant.log)
  251. \e bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
  252. and expect a list of all signatures requested by agent clients to
  253. build up in that log file.
  254. The log information is the same as that produced by the \cw{--debug}
  255. lifetime option, but \cw{--debug} sends it to standard output (since
  256. that is the main point of debugging mode) whereas \cw{-v} in all other
  257. lifetime modes sends the same log data to standard error (being a
  258. by-product of the program's main purpose). Using \cw{-v} in
  259. \cw{--debug} mode has no effect: the log still goes to standard
  260. output.
  261. }
  262. \dt \cw{-s}, \cw{-c}
  263. \dd Force Pageant to output its environment setup commands in the
  264. style of POSIX / Bourne shells (\cw{-s}) or C shells (\cw{-c})
  265. respectively. If neither option is given, Pageant will guess based on
  266. whether the environment variable \cw{SHELL} has a value ending in
  267. \cq{csh}.
  268. \dt \cw{--symlink} \e{fixed-path}
  269. \dd When operating in agent mode, as well as creating a uniquely named
  270. listening socket, \c{pageant} will also create (or update) a symbolic
  271. link at \e{fixed-path} pointing to that socket.
  272. \lcont{
  273. This allows access to an agent instance by setting the
  274. \c{SSH_AUTH_SOCK} environment variable to \e{fixed-path}, rather than
  275. having to use the value invented by \c{pageant} when it starts. It's
  276. mainly expected to be useful for debugging.
  277. }
  278. \dt \cw{--encrypted}, \cw{--no-decrypt}
  279. \dd When adding keys to the agent (at startup or later), keep them
  280. in encrypted form until the first attempt to use them; the user will
  281. be prompted for a passphrase then. Once decrypted, a key that was
  282. added in this way can be \q{re-encrypted} with the \cw{-r} or \cw{-R}
  283. client options.
  284. \lcont{
  285. The \cw{--encrypted} option makes no difference for key files which
  286. do not have a passphrase.
  287. (Storing keys in encrypted form is a Pageant extension; other agent
  288. implementations are unlikely to support it.)
  289. }
  290. \dt \cw{-E} \e{fingerprint-type}, \cw{--fptype} \e{fingerprint-type}
  291. \dd Specify the fingerprint format to print. Only applicable when
  292. listing fingerprints with \cw{-l}. The available formats are
  293. \cw{sha256} (the default) and \cw{md5}.
  294. \dt \cw{--gui-prompt}, \cw{--tty-prompt}
  295. \dd Force Pageant to prompt for key passphrases with a particular
  296. method (GUI or terminal) rather than trying to guess the most
  297. appropriate method as described above. (These options are relevant
  298. whenever a key file is specified to \c{pageant} that needs
  299. immediate decryption, and in \c{--askpass} mode.)
  300. \dt \cw{--help}
  301. \dd Print a brief summary of command-line options and terminate.
  302. \dt \cw{--version}, \cw{-V}
  303. \dd Print the version of Pageant.
  304. \dt \cw{--}
  305. \dd Cause all subsequent arguments to be treated as key file names,
  306. even if they look like options.