Security

SSH Keys and Server Passwords in KeePassXC for WinSCP

Published November 20, 2026

A padlock with its key removed, shown on a dark surface.
Photo: MarkJFernandes / Wikimedia Commons, CC0

Private SSH keys sitting in a Downloads folder are an easy way to lose control of a server. Keeping them in a password database, and loading them only when needed, is safer.

Store the material

  1. Create an entry in KeePassXC for each server. Put the hostname in the URL field and the username in the username field.
  2. Attach the private key file to the entry, using the attachments tab. Do not paste the key into the notes field.
  3. Use a long, unique passphrase on the key itself, and store that passphrase in the same entry.

Use it in WinSCP

  1. In WinSCP, create a session for the server with SFTP.
  2. Under the authentication settings, select the private key. WinSCP needs the .ppk format, which PuTTYgen can convert from an OpenSSH key.
  3. Save the session without the password, so that the key is requested when you connect.

Export the key from KeePassXC to a temporary folder only when needed, then delete the copy after use. Make sure the temporary folder is not synchronised to any cloud service.

Remove leftovers

Check your Downloads and Desktop folders for copies of keys. Check the WinSCP session list for saved passwords you no longer need.

See the secure file transfer checklist for the rest of the setup.

Sources