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