•If your server is OpenSSH and is using the SSH-2 protocol, you should follow the same instructions, except that in earlier versions of OpenSSH 2 the file might be called authorized_keys2. (In modern versions the same authorized_keys file is used for both SSH-1 and SSH-2 keys.)
•If your server is ssh.com's product and is using SSH-2, you need to save a public key file from PuTTYgen (see
section
8.2.9
), and copy that into the
.ssh2 directory on the server. Then you should go into that .ssh2 directory, and edit (or create) a file called authorization. In this file you should put a line like Key mykey.pub, with mykey.pub replaced by the name of your key file.
•For other SSH server software, you should refer to the manual for that server.
You may also need to ensure that your home directory, your .ssh directory, and any other files involved (such as authorized_keys, authorized_keys2 or authorization) are not group-writable or world-writable. You can typically do this by using a command such as
chmod go-w $HOME $HOME/.ssh $HOME/.ssh/authorized_keys
Your server should now be configured to accept authentication using your private key. Now you need to configure PuTTY to attempt authentication using your private key. You can do this in any of three ways:
•Select the private key in PuTTY's configuration. See
section 4.21.8
for details.
•Specify the key file on the command line with the -i option. See
section 3.8.3.18
for details.
•Load the private key into Pageant (see
chapter 9
). In this case PuTTY will automatically try to use it for authentication if it
can.
Chapter 9: Using Pageant for authentication
Pageant is an SSH authentication agent. It holds your private keys in memory, already decoded, so that you can use them often without needing to type a passphrase.
•
9.1 Getting started with Pageant
•
9.2 The Pageant main window
o
9.2.1 The key list box
o
9.2.2 The ‘Add Key’ button
o
9.2.3 The ‘Remove Key’ button
•
9.3 The Pageant command line
o
9.3.1 Making Pageant automatically load keys on startup
o
9.3.2 Making Pageant run another program
•
9.4 Using agent forwarding
•
9.5 Security considerations
9.1 Getting started with Pageant
Before you run Pageant, you need to have a private key in *.PPK format. See
chapter 8
to find out how to generate and use one.
When you run Pageant, it will put an icon of a computer wearing a hat into the System tray. It will then sit and do nothing, until you load a private key into it.
If you click the Pageant icon with the right mouse button, you will see a menu. Select ‘View Keys’ from this menu. The Pageant main window will appear. (You can also bring this window up by double-clicking on the Pageant icon.)
The Pageant window contains a list box. This shows the private keys Pageant is holding. When you start Pageant, it has no keys, so the list box will be empty. After you add one or more keys, they will show up in the list box.
To add a key to Pageant, press the ‘Add Key’ button. Pageant will bring up a file dialog, labelled ‘Select Private Key File’. Find your private key file in this dialog, and press ‘Open’.
Pageant will now load the private key. If the key is protected by a passphrase, Pageant will ask you to type the passphrase. When the key has been loaded, it will appear in the list in the Pageant window.