Ditch SSH Passwords: PuTTY Keys, Pageant and Sessions
Generate a key in PuTTYgen, save the connection as a session and let Pageant remember your passphrase, so logging into your server takes one double-click.
Ten logins a day into the Raspberry Pi in the closet, the web server at work or the router you keep tweaking, and every single time the same password dance. Key login fixes that and is safer too: the server only ever sees a one-time signature, never a secret it could leak. PuTTY 0.85 ships everything you need. PuTTYgen makes the keys, PuTTY stores your connection as a saved session, and Pageant holds the decrypted key so you type its passphrase once per Windows session. Budget about 15 minutes.
Step 1: Generate a key pair in PuTTYgen
PuTTYgen comes with the regular PuTTY installer. Open it from the Start menu.
- Under Parameters, pick the key type. EdDSA creates an Ed25519 key (255 bits), which is short, fast and accepted by any current OpenSSH server. If an older server needs RSA, choose RSA and keep Number of bits in a generated key at 2048 or higher.
- Click Generate.
- Wave your mouse over the empty area of the window until the progress bar fills. PuTTYgen uses those movements as randomness, so lazy circles are fine.
The key type sits at the bottom, the Generate button in the Actions block.
For RSA, generation can pause for a moment before it finishes. That's normal, because finding suitable primes is a random process.
Step 2: Protect and save the key
Once the key exists, new fields appear at the top of the window.
- Type something recognizable into Key comment, such as your name and the PC the key belongs to. PuTTY and Pageant show this text whenever they ask for the passphrase.
- Enter a strong passphrase into Key passphrase and repeat it in Confirm passphrase. Leaving both empty stores the key unencrypted, and then anyone who copies the file gets into your servers.
- Click Save private key and store the
.ppkfile somewhere only you can reach. - Select everything in the box Public key for pasting into OpenSSH authorized_keys file and copy it with Ctrl+C.
The public key text goes to the server. The .ppk file never leaves your PC.
Lost the clipboard contents? No problem. Click Load, open your .ppk and the public key shows up again. PuTTYgen saves in PPK version 3 by default. Only if you need the file in PuTTY 0.74 or older, or in a tool that can't read version 3, switch to version 2 under Key > Parameters for saving key files.
Step 3: Install the public key on the server
Log in once more with your password, using PuTTY as usual. On an OpenSSH server (Linux, Raspberry Pi OS, most NAS boxes), run:
mkdir -p ~/.ssh
chmod 700 ~/.ssh
nano ~/.ssh/authorized_keys
Paste the public key with a right-click into PuTTY, make sure it ends up on a single line, then save and exit. Finish with chmod 600 ~/.ssh/authorized_keys. Stay logged in for now, so you still have a way in if something goes wrong.
Step 4: Build a saved session
Open a second PuTTY window and set up the connection once, for good.
- In the Session panel, enter the Host Name, keep Port at 22 and Connection type at SSH.
- Go to Connection > Data and type your account into Auto-login username.
- Go to Connection > SSH > Auth > Credentials and use Browse next to Private key file for authentication to pick your
.ppk. - Return to Session, type a name into Saved Sessions (the server's name works well) and click Save.
From now on, a double-click on that name connects you. Enter the passphrase and you're in, no account password needed. If you want certain options for every new connection, select Default Settings in the list, adjust things and save that entry.
When PuTTY answers with "Server refused our key", the server didn't accept your public key. Check that it really sits on one line in authorized_keys, that the file permissions match Step 3 and that you log in with the same user you installed the key for. PuTTY's Event Log, reachable through the window menu, often shows what the server complained about.
Step 5: Let Pageant remember the passphrase
Typing the passphrase for every session gets old fast. Pageant is PuTTY's key agent: it keeps the decrypted key in memory and hands signatures to PuTTY on request.
- Start Pageant. An icon showing a computer wearing a hat appears in the notification area; you may have to open the hidden icons arrow to see it.
- Double-click the icon, or right-click it and choose View Keys.
- Click Add Key, select your
.ppkand type the passphrase one last time.
Pageant lists every loaded key with its type and fingerprint.
Now open as many saved sessions as you like. PuTTY checks for Pageant by default (Attempt authentication using Pageant is switched on) and logs you in without any prompt. Closing the key list window doesn't stop Pageant. To quit, right-click the tray icon and choose Exit, or pick Remove All Keys if you're stepping away from the PC.
Two extras are worth knowing. Add Key (encrypted) loads a key but keeps it locked until the first connection actually needs it, then asks for the passphrase. And Pageant can load keys at startup: create a shortcut whose target is pageant.exe followed by the path of your .ppk, then drop it into the Windows Startup folder (type shell:startup into the Run dialog with Win+R).
The same .ppk works in tools built around PuTTY's engine. WinSCP, for example, accepts it for file transfers.
Our verdict
If you log into the same Linux box more than once a week, key login with PuTTY is a quick win for comfort and security. Beginners get the most out of the saved session, admins with many servers will love Pageant. Do this today: generate an Ed25519 key with a passphrase, put it on your most-used server and save that connection as a session.


