Moving Beyond Passwords: Implementing SSH Key Authentication with PuTTY
Stop relying on vulnerable passwords. Learn how to implement SSH key authentication using PuTTYgen and Pageant to secure your remote server access.
07 May 2026, 21:25 UTC

The Vulnerability of the Password Prompt
\nRelying on passwords for remote server access creates a persistent security bottleneck. Passwords are susceptible to brute‑force attacks, credential stuffing, and human error. Even with a complex password, the manual entry process is tedious for engineers managing multiple environments.
\nThe solution is Public Key Infrastructure (PKI). By replacing a shared secret (the password) with a cryptographic key pair, you ensure that only the holder of a specific private key file can access the server. In the PuTTY ecosystem, this requires a specific workflow involving PuTTYgen and the .ppk file format.
Generating the Key Pair with PuTTYgen
\nPuTTY does not natively use the OpenSSH key format found in Linux or macOS. Instead, it uses a proprietary format with the .ppk (PuTTY Private Key) extension. To create these, you must use PuTTYgen, the standalone key generator utility.
When generating a key, you will encounter a choice of algorithms. While RSA is the most universally compatible, Ed25519 is the modern standard for better security and smaller key sizes. If your server is running an outdated version of OpenSSH (pre‑6.5), you may need to stick with RSA, ensuring the bit‑length is at least 2048 or 4096.
\nCrucially, you should apply a Key Passphrase. This encrypts the private key on your local disk, meaning that if your laptop is stolen, the attacker still cannot use the key without the passphrase.
\n\nDeploying the Public Key to the Server
\nThe private key stays on your machine. The public key—the string of text displayed in the PuTTYgen window—must be placed on the remote server. The SSH daemon (sshd) checks this list during the handshake to verify your identity.
\nThe public key must be appended to the ~/.ssh/authorized_keys file in the user’s home directory. A common point of failure is incorrect file permissions; the SSH daemon will ignore the key if the directory or file is world‑writable.
Example: Manual Key Installation
\nAssuming you have temporary password access to your server, run these commands on the remote Linux server as the target user:
\n# Create the .ssh directory if it doesn't exist
mkdir -p ~/.ssh\n\n# Set directory permissions to read/write/execute for the owner only
chmod 700 ~/.ssh\n\n# Append the public key string from PuTTYgen to the authorized_keys file
# Replace 'ssh-rsa AAAAB3...' with your actual public key string
echo \"ssh-rsa AAAAB3...user@workstation\" >> ~/.ssh/authorized_keys\n\n# Set file permissions to read/write for the owner only
chmod 600 ~/.ssh/authorized_keys\nRisk: If you disable password authentication before verifying the key works, you may lock yourself out of the server permanently.
\n\nConfiguring PuTTY for Automatic Login
\nOnce the server is prepared, you must tell PuTTY which private key to present during the connection attempt.
\n- \n
- Open PuTTY and navigate to Connection > SSH > Auth (In newer versions, this is under Auth > Credentials). \n
- In the Private key file for authentication field, browse to and select your
.ppkfile. \n - Return to the Session category, enter your hostname, and save the session to avoid repeating this configuration. \n
Streamlining with Pageant
\nEntering a key passphrase for every single session is a friction point. Pageant is an SSH authentication agent that runs in the background. You load your .ppk file into Pageant once at the start of your workday, and PuTTY will automatically query Pageant for the key whenever you connect to a server. This provides the security of an encrypted key with the convenience of a passwordless login.
Limitations and Verification
\nThe primary limitation of this setup is the proprietary nature of .ppk files. If you need to move your keys to a Linux‑based SSH client, you must use the "Conversions" menu in PuTTYgen to export the key to OpenSSH format.
To verify the authentication was successful and not falling back to a password, check the server's authentication logs. Run the following command on the remote server with sudo privileges:
\nsudo grep "Accepted publickey" /var/log/auth.log\nIf you see an entry matching your username and the timestamp of your login, the cryptographic handshake was successful.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.