Step 4.6 How to use PuTTY Passphrase Agents

Action 4 6 1 Use Pageant to store your private keys in memory

To make public key authentication more convenient , the developers of PuTTY created Pageant.

Pageant is a program included with PuTTY that will keep your decrypted private keys in memory so you only have to enter your passphrase once rather than every time you authenticate to a server using public key authentication.

While this will make your day-to-day use more convenient, please keep in mind that it also poses a slight risk, since other applications (including viruses) might be able to access these decrypted keys in memory.

To use Pageant:

If the passphrase you entered was incorrect, you will be re-prompted.

Action 4 6 2 Verify Pageant has your private key stored

Now we should verify that the key is loaded into Pageant:

Action 4 6 3 Using Pageant to automatically log in to a remote machine

Now that we have verified that our key is loaded into Pageant, we can attempt to log in to a remote machine automatically:

Action 4 6 4 Using Pageant with command line tools

If Pageant is already running in the background, the command line tools that come with PuTTY will automatically detect this and will authenticate with Pageant. An example of PSCP copying a file to a remote server is shown below. The “v verbose option has been added to see PSCP communicate with Pageant:

C:>pscp --v test.txt sshuser@server.example.com:. Looking up host "server.example.com" Connecting to 192.168.1.10 port 22 Server version: SSH-2.0-OpenSSH_3.1p1 We believe remote version has SSH2 RSA padding bug We claim version: SSH-2.0-PuTTY-Release-0.53b Using SSH protocol version 2 Doing Diffie-Hellman group exchange Doing Diffie-Hellman key exchange Host key fingerprint is: ssh-rsa 1024 41:61:b5:ab:c5:c5:01:46:ac:ef:a1:28:54:c0:1c:53 Using username "sshuser". Pageant is running. Requesting keys. Pageant has 1 SSH2 keys Trying Pageant key #0 Authenticating with public key "sshuser@server.example.com" from agent Sending Pageant's response Access granted Opened channel for session Started a shell/command Connected to server.example.com Sending file test.txt, size=1477 test.txt 1 kB 1.4 kB/s ETA: 00:00:00 100% Sent EOF message Server sent command exit status 0 C:>

Категории