Putty and Pageant public key auth not working anymore (win7 x64)

3

I have always used putty and pageant together for passwordless authentification, It was working fine before I changed my public/private key.

Now it is not working on either of my servers (I have added the new public key there too)

I also changed the path where pageant binary is stored (now in the same folder than putty). I think some other pageant binary are also present on my machine, along some other apps like (tortoiseSVN), could it be the problem? Something in the registry?

I cleaned trusted keys.

I had ptman before (when it was working) but i removed it. Could it be related?

I have also checked my conf in putty which look like this:

enter image description here

But so far I haven(t been able to fix the problem, and I spent hours on google trying to find something...

Does anybody ever had a similar problem? Or a clue of why I have it?

I'd greatly appreciate any help.

Maresh

Posted 2013-05-28T08:45:52.387

Reputation: 161

I use the installer package of the PuTTY suite on Win7 x64 without any problems, maybe you should try that. Also, if you are using pageant, you don't need to provide a private key in PuTTY. If you want to hop from the server you connect to to others, you will need to enable agent forwarding. – Janos Pasztor – 2013-05-28T08:50:26.743

Yea, I added the private key in putty as a desperated move... What do you mean by "hop from the server"? I'll try the package right away. – Maresh – 2013-05-28T08:52:24.283

Nope... Still asking for password :/ Tried with the default conf too. – Maresh – 2013-05-28T08:55:29.967

You need to look at the server logs then and maybe launch the SSH server in debug mode. You will see if the key authentication is even attempted. If it is, you have most probably messed up / forgotten to update your authorized_keys file. Also play a CLOSE attention to permissions on that file because OpenSSH won't let you use it unless it's secure. – Janos Pasztor – 2013-05-28T09:02:03.550

from the log it looks like it can't even read the key May 28 11:09:45 ks391358 sshd[22629]: error: key_read: key_from_blob AAAAB3NzaC1yc2EAAAABJQAA
AIBn3HpPfwiUuht2Lig5p3OJMhW1uy+iYaVgwAdg\n failed
– Maresh – 2013-05-28T09:13:12.857

1This looks like your authorized_keys file is messed up. Take a close look if it's the right format. – Janos Pasztor – 2013-05-28T09:14:51.253

Ok, the format was messed up, probably from copy paste for line breaks. And needed ssh-rsa. Thx for help. – Maresh – 2013-05-28T09:34:12.790

Answers

3

After further investigation and Janoszen suggestion of reading the log (that I should I have done before)

The format of the key in the authorized key was messed up.

  1. Because of line breaks (key not on one line)
  2. Need to add ssh-rsa before the key line

Thanks for pointing me in the right direction.

Maresh

Posted 2013-05-28T08:45:52.387

Reputation: 161

3

User from which pageant running need be same as putty i was running pageant as admin and putty as user and it always prompted password

user17653

Posted 2013-05-28T08:45:52.387

Reputation: 41

I think I read this about 3 times before it clicked, and I figured out this was my problem. It seems that when Pageant started itself the first time, it probably asked for escalated privileges and I mindlessly clicked ok. After about an hour of debugging I finally just restarted Pageant, and this fixed my problem. :try_not_to_cry: – Chris Hill – 2018-09-02T20:25:25.937