Converting puttygen public key to OpenSSH format

27Nov2007

I keep forgetting this so I'm gonna write it here. Non-geeks, just keep walking.

The most common way to make a key on Windows is using Putty/Puttygen. Puttygen provides a neat utility to convert a linux private key to Putty format. However, what isn't addressed is that when you save the public key using puttygen it won't work on a linux server. Windows puts some data in different areas and adds line breaks.

The Solution:
When you get to the public key screen in creating your key pair in puttygen, copy the public key and paste it into a text file with the extension .pub. You will save you sysadmin hours of frustration reading posts like this.

HOWEVER, sysadmins, you invariably get the wonky key file that throws no error message in the auth log except, no key found, trying password; even though everyone else's keys are working fine, and you've sent this key back to the user 15 times.

ssh-keygen -i -f keyfile.pub > newkeyfile.pub

Should convert an existing puttygen public key to OpenSSH format.

Please feed the monkey on your way out.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
10 Jun16:48

thank you!

By amilan (not verified)

just the info I was looking for.

31 Mar01:41

Fantastic post. Bookmarked

By Zoran (not verified)

Fantastic post. Bookmarked this site and emailed it to a few friends, your post was that great, keep it up.online roulettepoker siteonline blackjackvideo pokerdownloading movies

24 Feb11:42

Very informative post - keep

By eq2 plat (not verified)

Very informative post - keep it up!

If you don't mind me asking, what drupal template have you got at the moment? It's amazing and I'd love to know the name of it.

02 Mar23:17

Thanks

By Tresler

This is just a default install of http://drupal.org/project/clean I think I tweaked a template or two to keep the nice dates in more areas. Panels, Views, and CCK make up the rest of it.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.