SSH-2 private keys have no standard format. OpenSSH and ssh.com
have different formats, and PuTTY's is different again. So a key generated with one client cannot immediately be used with another.
Using the ‘Import’ command from the ‘Conversions’ menu, PuTTYgen can load SSH-2 private keys in OpenSSH's format and ssh.com
's format. Once you have loaded one of these key types, you can then save it back out as a PuTTY-format key (*.PPK
) so that you can use it with the PuTTY suite. The passphrase will be unchanged by this process (unless you deliberately change it). You may want to change the key comment before you save the key, since some OpenSSH key formats contained no space for a comment, and ssh.com
's default comment format is long and verbose.
PuTTYgen can also export private keys in OpenSSH format and in ssh.com
format. To do so, select one of the ‘Export’ options from the ‘Conversions’ menu. Exporting a key works exactly like saving it (see section 8.2.10) - you need to have typed your passphrase in beforehand, and you will be warned if you are about to save a key without a passphrase.
For OpenSSH there are two options. Modern OpenSSH actually has two formats it uses for storing private keys: an older (‘PEM-style’) format, and a newer ‘native’ format with better resistance to passphrase guessing and support for comments. ‘Export OpenSSH key’ will automatically choose the oldest format supported for the key type, for maximum backward compatibility with older versions of OpenSSH; for newer key types like Ed25519, it will use the newer format as that is the only legal option. If you have some specific reason for wanting to use OpenSSH's newer format even for RSA, DSA, or ECDSA keys – for instance, you know your file will only be used by OpenSSH 6.5 or newer (released in 2014), and want the extra security – you can choose ‘Export OpenSSH key (force new file format)’.
Most clients for the older SSH-1 protocol use a standard format for storing private keys on disk. PuTTY uses this format as well; so if you have generated an SSH-1 private key using OpenSSH or ssh.com
's client, you can use it with PuTTY, and vice versa. Hence, the export options are not available if you have generated an SSH-1 key.