OSDN Git Service

Add VC++ Project files for PuTTY DLL without exported functions.
[ffftp/ffftp.git] / putty / DOC / PAGEANT.BUT
1 \define{versionidpageant} \versionid $Id: pageant.but 6610 2006-03-14 11:21:59Z jacob $\r
2 \r
3 \C{pageant} Using \i{Pageant} for authentication\r
4 \r
5 \cfg{winhelp-topic}{pageant.general}\r
6 \r
7 Pageant is an SSH \i{authentication agent}. It holds your \i{private key}s\r
8 in memory, already decoded, so that you can use them often\r
9 \I{passwordless login}without needing to type a \i{passphrase}.\r
10 \r
11 \H{pageant-start} Getting started with Pageant\r
12 \r
13 Before you run Pageant, you need to have a private key in \c{*.\i{PPK}}\r
14 format. See \k{pubkey} to find out how to generate and use one.\r
15 \r
16 When you run Pageant, it will put an icon of a computer wearing a\r
17 hat into the \ii{System tray}. It will then sit and do nothing, until you\r
18 load a private key into it.\r
19 \r
20 If you click the Pageant icon with the right mouse button, you will\r
21 see a menu. Select \q{View Keys} from this menu. The Pageant main\r
22 window will appear. (You can also bring this window up by\r
23 double-clicking on the Pageant icon.)\r
24 \r
25 The Pageant window contains a list box. This shows the private keys\r
26 Pageant is holding. When you start Pageant, it has no keys, so the\r
27 list box will be empty. After you add one or more keys, they will\r
28 show up in the list box.\r
29 \r
30 To add a key to Pageant, press the \q{Add Key} button. Pageant will\r
31 bring up a file dialog, labelled \q{Select Private Key File}. Find\r
32 your private key file in this dialog, and press \q{Open}.\r
33 \r
34 Pageant will now load the private key. If the key is protected by a\r
35 passphrase, Pageant will ask you to type the passphrase. When the\r
36 key has been loaded, it will appear in the list in the Pageant\r
37 window.\r
38 \r
39 Now start PuTTY and open an SSH session to a site that accepts your\r
40 key. PuTTY will notice that Pageant is running, retrieve the key\r
41 automatically from Pageant, and use it to authenticate. You can now\r
42 open as many PuTTY sessions as you like without having to type your\r
43 passphrase again.\r
44 \r
45 (PuTTY can be configured not to try to use Pageant, but it will try\r
46 by default. See \k{config-ssh-tryagent} and\r
47 \k{using-cmdline-agentauth} for more information.)\r
48 \r
49 When you want to shut down Pageant, click the right button on the\r
50 Pageant icon in the System tray, and select \q{Exit} from the menu.\r
51 Closing the Pageant main window does \e{not} shut down Pageant.\r
52 \r
53 \H{pageant-mainwin} The Pageant main window\r
54 \r
55 The Pageant main window appears when you left-click on the Pageant\r
56 system tray icon, or alternatively right-click and select \q{View\r
57 Keys} from the menu. You can use it to keep track of what keys are\r
58 currently loaded into Pageant, and to add new ones or remove the\r
59 existing keys.\r
60 \r
61 \S{pageant-mainwin-keylist} The key list box\r
62 \r
63 \cfg{winhelp-topic}{pageant.keylist}\r
64 \r
65 The large list box in the Pageant main window lists the private keys\r
66 that are currently loaded into Pageant. The list might look\r
67 something like this:\r
68 \r
69 \c ssh1    1024 22:c3:68:3b:09:41:36:c3:39:83:91:ae:71:b2:0f:04 k1\r
70 \c ssh-rsa 1023 74:63:08:82:95:75:e1:7c:33:31:bb:cb:00:c0:89:8b k2\r
71 \r
72 For each key, the list box will tell you:\r
73 \r
74 \b The type of the key. Currently, this can be \c{ssh1} (an RSA key\r
75 for use with the SSH-1 protocol), \c{ssh-rsa} (an RSA key for use\r
76 with the SSH-2 protocol), or \c{ssh-dss} (a DSA key for use with\r
77 the SSH-2 protocol).\r
78 \r
79 \b The size (in bits) of the key.\r
80 \r
81 \b The \I{key fingerprint}fingerprint for the public key. This should be\r
82 the same fingerprint given by PuTTYgen, and (hopefully) also the same\r
83 fingerprint shown by remote utilities such as \i\c{ssh-keygen} when\r
84 applied to your \c{authorized_keys} file.\r
85 \r
86 \b The comment attached to the key.\r
87 \r
88 \S{pageant-mainwin-addkey} The \q{Add Key} button\r
89 \r
90 \cfg{winhelp-topic}{pageant.addkey}\r
91 \r
92 To add a key to Pageant by reading it out of a local disk file,\r
93 press the \q{Add Key} button in the Pageant main window, or\r
94 alternatively right-click on the Pageant icon in the system tray and\r
95 select \q{Add Key} from there.\r
96 \r
97 Pageant will bring up a file dialog, labelled \q{Select Private Key\r
98 File}. Find your private key file in this dialog, and press\r
99 \q{Open}. If you want to add more than one key at once, you can\r
100 select multiple files using Shift-click (to select several adjacent\r
101 files) or Ctrl-click (to select non-adjacent files).\r
102 \r
103 Pageant will now load the private key(s). If a key is protected by a\r
104 passphrase, Pageant will ask you to type the passphrase.\r
105 \r
106 (This is not the only way to add a private key to Pageant. You can\r
107 also add one from a remote system by using agent forwarding; see\r
108 \k{pageant-forward} for details.)\r
109 \r
110 \S{pageant-mainwin-remkey} The \q{Remove Key} button\r
111 \r
112 \cfg{winhelp-topic}{pageant.remkey}\r
113 \r
114 If you need to remove a key from Pageant, select that key in the\r
115 list box, and press the \q{Remove Key} button. Pageant will remove\r
116 the key from its memory.\r
117 \r
118 You can apply this to keys you added using the \q{Add Key} button,\r
119 or to keys you added remotely using agent forwarding (see\r
120 \k{pageant-forward}); it makes no difference.\r
121 \r
122 \H{pageant-cmdline} The Pageant command line\r
123 \r
124 Pageant can be made to do things automatically when it starts up, by\r
125 \I{command-line arguments}specifying instructions on its command line.\r
126 If you're starting Pageant from the Windows GUI, you can arrange this\r
127 by editing the properties of the \i{Windows shortcut} that it was\r
128 started from.\r
129 \r
130 If Pageant is already running, invoking it again with the options\r
131 below causes actions to be performed with the existing instance, not a\r
132 new one.\r
133 \r
134 \S{pageant-cmdline-loadkey} Making Pageant automatically load keys\r
135 on startup\r
136 \r
137 Pageant can automatically load one or more private keys when it\r
138 starts up, if you provide them on the Pageant command line. Your\r
139 command line might then look like:\r
140 \r
141 \c C:\PuTTY\pageant.exe d:\main.ppk d:\secondary.ppk\r
142 \r
143 If the keys are stored encrypted, Pageant will request the\r
144 passphrases on startup.\r
145 \r
146 If Pageant is already running, this syntax loads keys into the\r
147 existing Pageant.\r
148 \r
149 \S{pageant-cmdline-command} Making Pageant run another program\r
150 \r
151 You can arrange for Pageant to start another program once it has\r
152 initialised itself and loaded any keys specified on its command\r
153 line. This program (perhaps a PuTTY, or a WinCVS making use of\r
154 Plink, or whatever) will then be able to use the keys Pageant has\r
155 loaded.\r
156 \r
157 You do this by specifying the \I{-c-pageant}\c{-c} option followed\r
158 by the command, like this:\r
159 \r
160 \c C:\PuTTY\pageant.exe d:\main.ppk -c C:\PuTTY\putty.exe\r
161 \r
162 \H{pageant-forward} Using \i{agent forwarding}\r
163 \r
164 Agent forwarding is a mechanism that allows applications on your SSH\r
165 server machine to talk to the agent on your client machine.\r
166 \r
167 Note that at present, agent forwarding in SSH-2 is only available\r
168 when your SSH server is \i{OpenSSH}. The \i\cw{ssh.com} server uses a\r
169 different agent protocol, which PuTTY does not yet support.\r
170 \r
171 To enable agent forwarding, first start Pageant. Then set up a PuTTY\r
172 SSH session in which \q{Allow agent forwarding} is enabled (see\r
173 \k{config-ssh-agentfwd}). Open the session as normal. (Alternatively,\r
174 you can use the \c{-A} command line option; see\r
175 \k{using-cmdline-agent} for details.)\r
176 \r
177 If this has worked, your applications on the server should now have\r
178 access to a Unix domain socket which the SSH server will forward\r
179 back to PuTTY, and PuTTY will forward on to the agent. To check that\r
180 this has actually happened, you can try this command on Unix server\r
181 machines:\r
182 \r
183 \c unixbox:~$ echo $SSH_AUTH_SOCK\r
184 \c /tmp/ssh-XXNP18Jz/agent.28794\r
185 \c unixbox:~$\r
186 \r
187 If the result line comes up blank, agent forwarding has not been\r
188 enabled at all.\r
189 \r
190 Now if you run \c{ssh} on the server and use it to connect through\r
191 to another server that accepts one of the keys in Pageant, you\r
192 should be able to log in without a password:\r
193 \r
194 \c unixbox:~$ ssh -v otherunixbox\r
195 \c [...]\r
196 \c debug: next auth method to try is publickey\r
197 \c debug: userauth_pubkey_agent: trying agent key my-putty-key\r
198 \c debug: ssh-userauth2 successful: method publickey\r
199 \c [...]\r
200 \r
201 If you enable agent forwarding on \e{that} SSH connection as well\r
202 (see the manual for your server-side SSH client to find out how to\r
203 do this), your authentication keys will still be available on the\r
204 next machine you connect to - two SSH connections away from where\r
205 they're actually stored.\r
206 \r
207 In addition, if you have a private key on one of the SSH servers,\r
208 you can send it all the way back to Pageant using the local\r
209 \i\c{ssh-add} command:\r
210 \r
211 \c unixbox:~$ ssh-add ~/.ssh/id_rsa\r
212 \c Need passphrase for /home/fred/.ssh/id_rsa\r
213 \c Enter passphrase for /home/fred/.ssh/id_rsa:\r
214 \c Identity added: /home/fred/.ssh/id_rsa (/home/simon/.ssh/id_rsa)\r
215 \c unixbox:~$\r
216 \r
217 and then it's available to every machine that has agent forwarding\r
218 available (not just the ones downstream of the place you added it).\r
219 \r
220 \H{pageant-security} Security considerations\r
221 \r
222 \I{security risk}Using Pageant for public-key authentication gives you the\r
223 convenience of being able to open multiple SSH sessions without\r
224 having to type a passphrase every time, but also gives you the\r
225 security benefit of never storing a decrypted private key on disk.\r
226 Many people feel this is a good compromise between security and\r
227 convenience.\r
228 \r
229 It \e{is} a compromise, however. Holding your decrypted private keys\r
230 in Pageant is better than storing them in easy-to-find disk files,\r
231 but still less secure than not storing them anywhere at all. This is\r
232 for two reasons:\r
233 \r
234 \b Windows unfortunately provides no way to protect pieces of memory\r
235 from being written to the system \i{swap file}. So if Pageant is holding\r
236 your private keys for a long period of time, it's possible that\r
237 decrypted private key data may be written to the system swap file,\r
238 and an attacker who gained access to your hard disk later on might\r
239 be able to recover that data. (However, if you stored an unencrypted\r
240 key in a disk file they would \e{certainly} be able to recover it.)\r
241 \r
242 \b Although, like most modern operating systems, Windows prevents\r
243 programs from accidentally accessing one another's memory space, it\r
244 does allow programs to access one another's memory space\r
245 deliberately, for special purposes such as debugging. This means\r
246 that if you allow a virus, trojan, or other malicious program on to\r
247 your Windows system while Pageant is running, it could access the\r
248 memory of the Pageant process, extract your decrypted authentication\r
249 keys, and send them back to its master.\r
250 \r
251 Similarly, use of agent \e{forwarding} is a security improvement on\r
252 other methods of one-touch authentication, but not perfect. Holding\r
253 your keys in Pageant on your Windows box has a security advantage\r
254 over holding them on the remote server machine itself (either in an\r
255 agent or just unencrypted on disk), because if the server machine\r
256 ever sees your unencrypted private key then the sysadmin or anyone\r
257 who cracks the machine can steal the keys and pretend to be you for\r
258 as long as they want.\r
259 \r
260 However, the sysadmin of the server machine can always pretend to be\r
261 you \e{on that machine}. So if you forward your agent to a server\r
262 machine, then the sysadmin of that machine can access the forwarded\r
263 agent connection and request signatures from your private keys, and\r
264 can therefore log in to other machines as you. They can only do this\r
265 to a limited extent - when the agent forwarding disappears they lose\r
266 the ability - but using Pageant doesn't actually \e{prevent} the\r
267 sysadmin (or hackers) on the server from doing this.\r
268 \r
269 Therefore, if you don't trust the sysadmin of a server machine, you\r
270 should \e{never} use agent forwarding to that machine. (Of course\r
271 you also shouldn't store private keys on that machine, type\r
272 passphrases into it, or log into other machines from it in any way\r
273 at all; Pageant is hardly unique in this respect.)\r