Convert an SSH Key for WinSCP
Convert OpenSSH private keys to PuTTY .ppk format, and back.
By the WinSCP Downloads Team · Last updated
Why do keys need converting?
OpenSSH, the SSH software on Linux and macOS, stores private keys in its own format: files such as id_ed25519 or id_rsa that start with a BEGIN OPENSSH PRIVATE KEY line. WinSCP and PuTTY use the .ppk format. Converting changes only the file format; the key itself, and the public key on your servers, stay the same.
What is the quickest way to convert a key?
Select the OpenSSH key in WinSCP (Advanced > SSH > Authentication > Private key file). WinSCP recognizes the format and offers to convert it; accept and save the new .ppk file.
How do you convert a key from the command line?
winscp.com has a /keygen switch for this:
winscp.com /keygen C:\keys\id_ed25519 /output=C:\keys\id_ed25519.ppkAdd /changepassphrase to set a new passphrase on the converted key at the same time.
How do you convert a .ppk key back to OpenSSH format?
- Open PuTTYgen (Login dialog > Tools > Run PuTTYgen).
- Click Load and select the .ppk file, entering its passphrase.
- Choose Conversions > Export OpenSSH key and save the file.
Use this when you need the same key in OpenSSH tools such as ssh or git on another computer.
How do you keep converted keys safe?
A converted file is as sensitive as the original: anyone who has it can log in as you. Keep a passphrase on it, store it only where you need it, and delete copies you no longer use.
Sources
This guide is written in our own words and checked against the official WinSCP documentation. For full details, see:
- Using PuTTYgen – winscp.net
- Command-line Options (/keygen) – winscp.net
Related pages
- Connect to SFTP with a Private Key – Log in to an SFTP server with an SSH key instead of a password.
- SSH Integration – How WinSCP fits alongside an SSH terminal workflow.
- Command Line Options – Running WinSCP non-interactively from the command line.
Part of the WinSCP documentation. Download WinSCP for Windows.