tommycoolman

tech. blog. repeat.

Menu
Menu
  • HOME
  • QR CODES
  • CONTACT

Public Key Authentication with PuTTY

Posted on April 4, 2021August 29, 2021 by tommy

Public Key authentication is one of the safest ways to log into a server. Instead of using a plain text password, Public Key authentication uses a Public/Private key pair to identify authorized users. The target server stores the Public Key while the user holds the Private Key.

Step 1: Generating Public / Private Keys with PuTTYGen

Download PuTTYgen and run it. You will need to

  • 1. Generate Keys
  • 2. Copy/Save your Public Key (to clipboard or file)
  • 3. Save your private Key (example: private.ppk)

Note: the “Save public key” will not save your Public Key in a format compatible with Linux ‘authorized_keys’

Step 2: Install Public Key on Linux Server

Log on to your target Linux server. Whatever user you login with will be the user you need to specify when you login automatically. In this case, I will use root.

Once you are logged in, use your preferred text editor (nano/pico/vi) and open ~/.ssh/authorized_keys. If this file doesn’t exist, create it.

Paste your Public Key at the end of the file. Your Public Key should be one long line.

Step 3: Setting up PuTTY

Configure your Host and Port

Specify your Login Username

Specify your saved Private Key file

Save the Session and click ‘Open’

Once you have tested to make sure everything works, pin PuTTY to your taskbar. Right clicking on the PuTTY icon will pull up your recent/saved connections.

Further Reading

Part 2: Securing Remote Desktop with SSH Tunneling

  • RetroArch on the 1st Generation Apple TV
    April 29, 2025
  • Modifying an Inkjet Printer for DTF Printing
    March 28, 2025
  • Designing a 7-node Proxmox/Ceph cluster in Blender
    July 25, 2023
  • Burn an Arduino Bootloader via Parallel Port
    June 20, 2023
©2025 tommycoolman