You have seen in previous tutorials how to use PuTTY to connect to your VPS securely and how to create SSH keys with PuTTYgen.
You might have more than one SSH key for a single cloud server, or simply more than one cloud server or Droplet that requires SSH keys to log into. This can make you feel overwhelmed with having to manage, sort out, and link all those keys to their respective servers. That’s why Pageant exists.
Pageant is a PuTTY authentication agent. It holds your private keys in memory so that you can use them whenever you are connecting to a server. It eliminates the need to:
Make sure you have these prerequisites.
Start Pageant from the PuTTY folder: Start-Menu > All Programs > PuTTY > Pageant
Pageant starts by default minimized in the system tray. To begin adding your SSH keys, you should right click on its icon and then the following context menu will show up:
Clicking on Add Key from the menu or View Keys to open up the Pageant Key List window. Here you can view, add, and remove keys:
Tip: You can access the Pageant Key List window directly by double-clicking its icon in the system tray.
Click the Add Key button. This will open the file explorer, where you can choose one or more keys at a time to load. You should select files with the .ppk extension:
Click the Open button to load the keys with Pageant.
If a key is passphrase-protected, you will be prompted to enter the passphrase only once before it can be added to the Pageant Key List:
After successfully adding a key, you can now see it listed:
Now these keys will be available while connecting to any server during your PuTTY sessions. You don’t have to take any extra steps in PuTTY. Just enter your hostname or IP address, and SSH user. PuTTY will automatically try to authenticate using any keys currently loaded in Pageant.
If you want to remove a key from Pageant, select that key from the Pageant Key List window and press the Remove Key button. You can also remove multiple keys together by selecting them with CTRL or SHIFT.
Use these tips to automate your authenticated connections with Pageant.
You can make Pageant automatically load one or more private keys when it starts up, instead of adding them manually every time you start up Pageant.
Go to the Pageant shortcut icon from the Windows Start Menu or your desktop.
Right click on the icon, and click on Properties.
A new window will open containing the shortcut’s properties:
From the Shortcut tab, edit the Target field. Leave the path to pageant.exe intact. After that path, add paths to your .ppk key files. These should be outside the quotation marks. Here’s an example:
"C:\Program Files\PuTTY\pageant.exe" C:\key1.ppk C:\key2.ppk
Click the Apply and then OK buttons.
Note: If the keys are encrypted, Pageant will request the passphrases on startup.
You can make Pageant start PuTTY or any other program once it has initialized itself and loaded any keys specified on its command line. That way you can just start Pageant instead of having to start both programs.
You can achieve this by following the same steps we used previously to add the keys automatically (see the previous section). Just add the program’s path at the end of the command in the Target field, preceded by the -c option, and contained within double quotes. Here’s an example of the full line for the Target field:
"C:\Program Files\PuTTY\pageant.exe" C:\key1.ppk C:\key2.ppk -c "C:\Program Files\PuTTY\putty.exe"
Here are a few other helpful applications that can work with PuTTY.
Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Sign up for Infrastructure as a Newsletter.
Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Thank you! I would just note:
1 If your path to the key contains spaces like in “C:\Users\Gimli\keys\my precious.ppk” then the path must be in quotes.
"C:\Program Files\PuTTY\pageant.exe" C:\key1.ppk C:\key2.ppk "C:\Users\Gimli\keys\my precious.ppk"
2 If you want pageant to startup automatically with Windows 10, one of the ways you can do it is by adding a key for it to your registry.
Reference: http://http://www.tenforums.com/tutorials/2944-startup-items-add-delete-enable-disable-windows-10-a.html
"C:\Program Files\PuTTY\pageant.exe" C:\key1.ppk C:\key2.ppk "C:\Users\Gimli\keys\my precious.ppk"
Agent forwarding for later adventures is worth mentioning too. Details in the manual which is unfortunately not available or not documented to be a common command-line switch of pageant as usually (–help, -h neither /? tells that).