Sitting on a freshly installed Linux computer, I needed to download a git repository to this machine, but hadn’t installed my ssh keys. Historically, I have a Synology device that I sync files between computers, and that had been installed. My PPK key, along with what I thought were my public/private keys are located within this synchronized folder, so I nagivate to those files, copy them, and paste them into ~/.ssh and re-try and it failed. The error message came up with something to the effect of invalid key format and would not continue.

Confused, I searched the Internet trying to figure this out, until I re-thought the issue, and given I still have the ppk file, I re-serched the Internet looking for how to generate the public and private ssh key(s) that are used for Linux. Of all things, StackOverflow had the answer here. Below is the answer, which I’m copying from the StackOverflow article, so I have this reference in the future:

  • Linux: With your package manager, install PuTTY (or the more minimal PuTTY-tools):
    • Ubuntu sudo apt-get install putty-tools
    • Debian-like apt-get install putty-tools
    • RPM based yum install putty
    • Gentoo emerge putty
    • Archlinux sudo pacman -S putty
    • etc.
  • OS X: install Homebrew, then run brew install putty

Place your keys in some directory, e.g. your home folder. Now convert the PPK keys to SSH keypairs:

To generate the private key:

cd ~ puttygen id_dsk.ppk -O private-openssh -o ~/.ssh/id_dsa

and to generate the public key:

puttygen id_dsa.ppk -O public-openssh -o ~/.ssh/id_dsa.pub

Now, set the proper permissions on the file:

chmod 600 ~/.ssh/id_dsa chmod 666 ~/.ssh/id_dsa.pub

Everything should now work, and you can fetch your stuff from git via ssh.

*Side Note: If the ~/.ssh/ folder does not exist, create it, then follow the instructions above.