GardenCloud & systems

Converting a PuTTY key for an OpenSSH client

Historical Linux and macOS commands for changing a private key's file format without changing its purpose.

A .ppk file and an OpenSSH private-key file are different encodings used by different clients. Converting the file does not create a new authorized account or make a server trust the key automatically.

The Linux sequence

sudo apt-get install putty-tools
puttygen ppkkey.ppk -O private-openssh -o pemkey.pem
cp pemkey.pem ~/.ssh
chmod 400 pemkey.pem
ssh -i pemkey.pem user@ec2-instancedotcom

The copied destination and the file whose permissions are changed must be the same intended key. Paths in the original short sequence assume the corresponding working directory.

The reverse conversion was:

puttygen pemKey.pem -o ppkKey.ppk -O private

The macOS sequence

brew install putty
puttygen privatekey.ppk -O private-openssh -o privatekey.pem
chmod go-rw privatekey.pem
ssh -i privatekey.pem ec2-user@my.server.com

-o selects the output file and -O selects the format. These historical commands include private-key outputs; no key files were imported, converted, or used to connect for this revision.

← Back to the garden