Linux - Convert Putty private key to OpenSSH keys
If you are migrating your keys from Putty Windows to linux it won't work with the OpenSSH client and you will be able to convert them with the steps below :
tiago@linux-desktop ~/D/s/T/H/p/SSH> sudo apt install putty
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
putty-tools
Suggested packages:
putty-doc
The following NEW packages will be installed
putty putty-tools
0 to upgrade, 2 to newly install, 0 to remove and 0 not to upgrade.
use the command below to convert the key :
tiago@linux-desktop ~/D/s/T/H/p/SSH> puttygen hv2-ssh_private_key.ppk -O private-openssh -o hv2-ssh-openssh.key
Enter passphrase to load key:
tiago@linux-desktop ~/D/s/T/H/p/SSH> ll
total 16K
-rwxr-xr-- 1 tiago tiago 732 May 24 2020 authorized_keys
-rw------- 1 tiago tiago 3.3K Jun 2 14:41 hv2-ssh-openssh.key
-rwxr-xr-- 1 tiago tiago 2.7K May 24 2020 hv2-ssh_private_key.ppk
-rwxr-xr-- 1 tiago tiago 829 May 24 2020 pub.key
-O
- specify output type:
private output PuTTY private key format
private-openssh export OpenSSH private key
private-openssh-new export OpenSSH private key (force new format)
private-sshcom export ssh.com private key
public RFC 4716 / ssh.com public key
public-openssh OpenSSH public key
fingerprint output the key fingerprint
-o
- specify output file