Arrgh, and "password" should be spelled "passphrase".
[u/mdw/putty] / doc / pageant.but
CommitLineData
8f1529bc 1\versionid $Id: pageant.but,v 1.4 2001/11/25 16:57:45 simon Exp $
2
e5b0d077 3\C{pageant} Using Pageant for authentication
4
5Pageant is an SSH authentication agent. It holds your private keys
6in memory, already decoded, so that you can use them often without
7needing to type a passphrase.
8
e5b0d077 9\H{pageant-start} Getting started with Pageant
10
55ba634a 11Before you run Pageant, you need to have a private key. See
12\k{pubkey} to find out how to generate and use one.
e5b0d077 13
14When you run Pageant, it will put an icon of a computer wearing a
15hat into the System tray. It will then sit and do nothing.
16
17If you click the Pageant icon with the right mouse button, you will
18see a menu. Select \e{View Keys} from this menu. The Pageant main
19window will appear. (You can also bring this window up by
20double-clicking on the Pageant icon.)
21
22The Pageant window contains a list box. This shows the private keys
23Pageant is holding. When you start Pageant, it has no keys, so the
24list box will be empty.
25
26To add a key to Pageant, press the \e{Add Key} button. Pageant will
27bring up a file dialog, labelled \q{Select Private Key File}. Find
28your private key file in this dialog, and press \e{Open}.
29
30Pageant will now load the private key. If the key is protected by a
31passphrase, Pageant will ask you to type the passphrase. When the
32key has been loaded, it will appear in the list in the Pageant
33window.
34
35Now start PuTTY and open an SSH session to a site that accepts your
36key. PuTTY will notice that Pageant is running, retrieve the key
37automatically from Pageant, and use it to authenticate. You can now
38open as many PuTTY sessions as you like without having to type your
39passphrase again.
40
41When you want to shut down Pageant, click the right button on the
42Pageant icon in the System tray, and select \e{Exit} from the menu.
43Closing the Pageant main window does \e{not} shut down Pageant.
44
45\H{pageant-forward} Using agent forwarding
46
8f1529bc 47Agent forwarding is a mechanism that allows applications on your SSH
48server machine to talk to the agent on your client machine.
49
50Note that at present, agent forwarding in SSH2 is only available
51when your SSH server is OpenSSH. The \cw{ssh.com} server uses a
52different agent protocol which they have not published. If you would
53like PuTTY to be able to support agent forwarding to an \cw{ssh.com}
54server, please write to \cw{ssh.com} and explain to them that they
55are hurting themselves and their users by keeping their protocol
56secret.
57
58To enable agent forwarding, first start Pageant. Then set up a PuTTY
59SSH session in which \q{Allow agent forwarding} is enabled (see
60\k{config-ssh-agentfwd}). Open the session as normal.
61
62If this has worked, your applications on the server should now have
63access to a Unix domain socket which the SSH server will forward
64back to PuTTY, and PuTTY will forward on to the agent. To check that
65this has actually happened, you can try this command on Unix server
66machines:
67
68\c unixbox:~$ echo $SSH_AUTH_SOCK
69\c /tmp/ssh-XXNP18Jz/agent.28794
70\c unixbox:~$
71
72If the result line comes up blank, agent forwarding has not been
73enabled at all.
74
75Now if you run \c{ssh} on the server and use it to connect through
76to another server that accepts one of the keys in Pageant, you
77should be able to log in without a password:
78
79\c unixbox:~$ ssh -v otherunixbox
80\c [...]
81\c debug: next auth method to try is publickey
82\c debug: userauth_pubkey_agent: trying agent key my-putty-key
83\c debug: ssh-userauth2 successful: method publickey
84\c [...]
85
86If you enable agent forwarding on \e{that} SSH connection as well
87(see the manual for your server-side SSH client to find out how to
88do this), your authentication keys will still be available on the
89next machine you connect to - two SSH connections away from where
90they're actually stored.
91
92In addition, if you have a private key on one of the SSH servers,
93you can send it all the way back to Pageant using the local
94\c{ssh-add} command:
95
96\c unixbox:~$ ssh-add ~/.ssh/id_rsa
97\c Need passphrase for /home/fred/.ssh/id_rsa
98\c Enter passphrase for /home/fred/.ssh/id_rsa:
99\c Identity added: /home/fred/.ssh/id_rsa (/home/simon/.ssh/id_rsa)
100\c unixbox:~$
101
102and then it's available to every machine that has agent forwarding
103available (not just the ones downstream of the place you added it).
e5b0d077 104
105\H{pageant-security} Security considerations
106
8f1529bc 107Using Pageant for public-key authentication gives you the
108convenience of being able to open multiple SSH sessions without
109having to type a passphrase every time, but also gives you the
110security benefit of never storing a decrypted private key on disk.
111Many people feel this is a good compromise between security and
112convenience.
113
114It \e{is} a compromise, however. Holding your decrypted private keys
115in Pageant is better than storing them in easy-to-find disk files,
116but still less secure than not storing them anywhere at all. This is
117for two reasons:
118
119\b Windows unfortunately provides no way to protect pieces of memory
120from being written to the system swap file. So if Pageant is holding
121your private keys for a long period of time, it's possible that
122decrypted private key data may be written to the system swap file,
123and an attacker who gained access to your hard disk later on might
124be able to recover that data. (However, if you stored an unencrypted
125key in a disk file they would \e{certainly} be able to recover it.)
126
127\b Although, like most modern operating systems, Windows prevents
128programs from accidentally accessing one another's memory space, it
129does allow programs to access one another's memory space
130deliberately, for special purposes such as debugging. This means
131that if you allow a virus, trojan, or other malicious program on to
132your Windows system while Pageant is running, it could access the
133memory of the Pageant process, extract your decrypted authentication
134keys, and send them back to its master.
135
136Similarly, use of agent \e{forwarding} is a security improvement on
137other methods of one-touch authentication, but not perfect. Holding
138your keys in Pageant on your Windows box has a security advantage
139over holding them on the remote server machine itself (either in an
140agent or just unencrypted on disk), because if the server machine
141ever sees your unencrypted private key then the sysadmin or anyone
142who cracks the machine can steal the keys and pretend to be you for
143as long as they want.
144
145However, the sysadmin of the server machine can always pretend to be
146you \e{on that machine}. So if you forward your agent to a server
147machine, then the sysadmin of that machine can access the forwarded
148agent connection and request signatures from your public keys, and
149can therefore log in to other machines as you. They can only do this
150to a limited extent - when the agent forwarding disappears they lose
151the ability - but using Pageant doesn't actually \e{prevent} the
152sysadmin (or hackers) on the server from doing this.
153
154Therefore, if you don't trust the sysadmin of a server machine, you
155should \e{never} use agent forwarding to that machine. (Of course
156you also shouldn't store private keys on that machine, type
157passphrases into it, or log into other machines from it in any way
158at all; Pageant is hardly unique in this respect.)