Forums

SSH keys into putty

Hi there,

I've followed this guide and then downloaded the two generated files. https://help.pythonanywhere.com/pages/SSHAccess/

How can I now use these with putty to login without having to enter a password?

Thank you!

Use ssh key. Putty supports it.

So I did use sshkey as shown in the help documentation to generate the two files - and downloaded them. How can I get them into putty? Putty seems to want to use it's own ppk key format?

There is a companion program in the PuTTY suite called Pageant. You load keys into there for PuTTY to use.

The current release 0.78 supports direct use of OpenSSH keys. Before that you had to convert those into PuTTY's PPK format.

Thanks! I am on Putty 0.78 and when I just point the credentials bit to the files I have downloaded this is what I get: https://ibb.co/Njytbz3

Unable to use key file "[path was here]\secrets\id_rsa_pythonanywhere" (OpenSSH SSH-2 private key (new format)) Unable to use certificate file "[path was here]\secrets\id_rsa_pythonanywhere.pub" (ke y type 'ssh-rsa' is not a certificate) login as: Unable to use key file "[path was here]\secrets\id_rsa_pythonanywhere" (Open SSH SSH-2 private key (new format))

What I did is I downloaded the keys from this step below onto my computer - is that the right thing to do?

$ ssh-keygen -t rsa -b 2048 Generating public/private rsa key pair. Enter file in which to save the key (/home/username/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/username/.ssh/id_rsa. Your public key has been saved in /home/username/.ssh/id_rsa.pub.

Similar issue with Pageant - Could not load this key (OpenSSH SSH-2 private key (new format))

Apologies, I was going on the PuTTY release notes. I've just failed to open an OpenSSH key in my Pageant and got a similar error "Couldn't load this key (OpenSSH SSH-2 private key (old PEM format))". Perhaps that will be fixed in the upcoming 0.79 which is in preview.

It looks as if the old procedure is still needed. Open PuTTYgen and select the Conversions tab. That should be able to import your keys. Use Save private key to save it in PuTTY's PPK format.

No worries at all, thank you for your help and that's great to know.

In that case I just used puttygen to generate the keys and added that to the server - bit easier haha!

Thank you for your help.

Glad to hear that you made it!