-3

I have a local workstation Running Windows called myDesktop where I'm logged on with user name 'windowsLogin', and a Linux target server called myLinux, where I must ssh-log with user 'linuxLogin'.

From MobaXterm running on the Windows machine, I can generate a key and copy it to myLinux:

local$ /bin/ssh-keygen
local$ cat .ssh/id_rsa.pub |ssh myLinux 'cat >> .ssh/authorized_keys'
local$ ssh myLinux      <========= OK fine it worked !

This id_rsa.pub contains now a line ending up with "windowsLogin@MYDESKTOP".

How do I achieve the same with putty as that stills asks me for a password, i.e. password of user specified in putty saved session under Connection -> Data in field 'Auto-login username' (which is different from my OS desktop 'windowsLogin')...

I already tried:

  • replacing the auto-login user name with my linuxLogin
  • to click 'Use system username (Seb FamilyName)' by leaving the field 'Auto-login username' empty...
  • copying the public key generated by puttygen on myLInux in .ssh/authrorized_keys (string ending up with "rsa-key-20180111")

And none of those work...

Is it possible to get putty working with an ssh key to avoid typing a password?

  • 1
    Putty needs its key in a different format - meinit.nl/using-your-openssh-private-key-in-putty – ivanivan Jan 11 '18 at 21:54
  • 2
    Unless I'm misunderstanding your question, yes it's perfectly possible. You can either import/convert the existing OpenSSH private key into PuTTY's PPK format using puttygen, or generate a new keypair using puttygen and copy the OpenSSH-compatible public key to the server's ~/.ssh/authorized_keys file – steeldriver Jan 11 '18 at 21:55
  • "Is it really possible to get putty working with ssh key to avoid typing a password all the while? " Yes, it is. It's been working fine for something over 15 years now with many versions of windows on one side and linux/hpux/solaris/*bsd on the other. This reads more as a rant than a focused question appropriate for this site. – user4556274 Jan 11 '18 at 23:03
2

Yes, you can use key pair authentication with PuTTY. However, PuTTY expects a different format for private key files. Use the included PuTTYgen program to convert the private key you generated with ssh-keygen to one PuTTY can use (or alternatively generate a new keypair for your Windows box to use with PuTTY).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.