Net-SSH Prompts for Passphrase even with keys loaded in ssh-agent
Reported by adlongwell | April 20th, 2011 @ 07:41 PM
I formerly had version 2.0.24 of Net::SSH. After upgrading, I'm suddenly prompted for my private key passphrase on every connection even though I have ssh-agent running with the key loaded. An ssh connection in the same terminal window connects fine to the same server with no passphrase request.
I noticed the problem through Capistrano, but the problem is reproducible with a simple Net::SSH script directly.
I downgraded back to 2.0.24 and the problem was fixed. After up and downgrading each version between 2.0.24 and the latest, I've narrowed the problem to this commit:
https://github.com/net-ssh/net-ssh/commit/05601f7e650942ecea1e5d179...
My key file is ~/.ssh/id_dsa, but I do not have a ~/.ssh/id_dsa.pub file with my public key in the ~/.ssh directory. I haven't debugged in code, but I believe something about that commit is causing the file-based lookups to start ignoring the data received from ssh-agent.
My assumptions seem correct, because creating an id_dsa.pub file containing my public key also fixes the problem.
Comments and changes to this ticket
-

Alex April 27th, 2011 @ 12:43 PM
The same problem. Used many keys, but without pub. Do 'ssh-add', but always need enter passphrase again. This is not good, because for capistrano-ext I cann't deploy. Problem solved only downgrade to net-ssh 2.0.24.
-

Lee Hambley May 13th, 2011 @ 09:42 AM
- Assigned user set to Delano Mandelbaum
+1 I have the same problem (and, also no
.pubversion of my key…) I'll try to draw Delano's attention to this ticket. -

Delano Mandelbaum May 13th, 2011 @ 09:52 AM
- State changed from new to open
Thanks for the detailed report and confirmation guys. I'll forward this issue to the committer of that pull request (Net::SSH is in maintenance mode so most of the changes happen via patches).
-

Musy Bite August 23rd, 2011 @ 10:46 AM
Thanks for report and sorry for such long delay!
I've submitted pull request.
-

Delano Mandelbaum August 24th, 2011 @ 11:39 AM
- State changed from open to resolved
Thanks for the fix. It's in release 2.2.1.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
Please do not create new issues here. Use github issues instead:
https://github.com/net-ssh/net-ssh/issues