Using a PuTTY private key from windows to linux

cn flag

I've generated two keys on PuTTY: public and private. Using this software on windows I can connect to the server as usual.

Then I tried to copy those files in my ubuntu machine (21.04), and logged in loading the private key (open putty, write the user@hostname and then load the private key at SSH>Auth), but there is unable to connect being rejected by the server as this error says:

Unable to load key file '~/private_key.ppk' (PuTTY key format too new). 

And an emerging windows appears saying:

No supported authentication methods available (server sent: publickey)

So, as the first error suggest, after convert the private key to openssh PEM format through PuTTYgen and then load that file to SSH/Auth, the 'No supported' message remains before:

Unable to use key file '~/private_key_openssh' (OpenSSH SSH-2 private key (old PEM format) ).

Is there any way to use these keys on Ubuntu? Maybe through openssh?

Some info that will be useful:

  • New installed version of Ubuntu
  • PuTTY 0.74

The output while trying with ssh -i ~/.ssh/private_key.ppk user@hostname

Load key "~/.ssh/private_key.ppk": invalid format user@hostname: Permission denied (publickey).

ru flag
On Windows, export your PPK within puttygen to OpenSSH format privkey, and copy the pubkey info from the window. The Ubuntu version of PuTTY and PuTTYgen may be 'too old' if you're using the latest PuTTY from upstream, and as such you need to do the exports on Windows, then copy your keys over to Ubuntu.
cn flag

Connection achieved!

As suggested by Thomas Ward, loading the private_key file to PuTTYgen on Windows and copying the public key to the authorized-keys file worked as a first step.

Moreover, exporting the private_key file as openssh format, the first option, to private_OpenSSH file and then move it to the ~/.ssh directory to change permissions with:

chmod 400 private_OpenSSH

Allowed me to finally connect with:

ssh -i ~/private_OpenSSH user@hostname

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.