-
Notifications
You must be signed in to change notification settings - Fork 253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrading 1.10.0 to 1.11.1 breaks connecting to new hosts. #362
Comments
Seems to be related to #330 - turning on known hosts caching in 1.10.0 (and removing those servers from my known hosts) recreated the problem. |
So I wrote this reproduction code: https://gist.github.com/byroot/37d40fd9e2883c40aef00bfc40c0931d So far things don't add up. Both Also So maybe I'm missing some info here:
|
It's starting to look like a peculiarity of my setup. Corporate network weirdness demands I go through multiple SSH tunnel hops to get to the machines I care about. The ones I have SSH set up to route with purely The interesting bit is that when SSHKit and Proxifier interact, "hostnames" (IPs?) are reported weirdly. Say I'm trying to get to IP 10.52.186.21 - leaving DNS out of this to avoid complication. I start from a blank known hosts file each time, and SSH mean standard command-line
Actually, that last one surprised me by working - that's the one that always broke for me when I wasn't starting from a blank known hosts file. And sure enough, leaving that entry in known hosts and then trying to SSHKit + Proxifier into the next host in that series (10.52.186.22) recreated the crash. So it seems like the new code is getting its first hostname match on the 127.0.0.1 part, returning a different server's key, and failing with a key mismatch. Is there a spec on what to do with comma-separated names in And the info for byroot, in case it's still relevant: I'm using Net::SSH 3.2.0. I'm starting from a blank known hosts file. My SSH config looks like this when using Proxifier (over port 39999); to use pure SSH proxying I uncomment those last two lines and turn Proxifier off:
|
Xavier, Jean - I just wanted to congratulate you both on some excellent debugging and open source peership, 🎩-off to both of you. |
I believe this is the logic that makes this work in the original Net::SSH implementation: found = entries.all? { |entry| hostlist.include?(entry) } ||
known_host_hash?(hostlist, entries, scanner)
next unless found
|
Thanks @leehambley! You guys make some some awesome tools - glad I can give back. |
Sorry I didn't have much time to tackle this in the last few days. I just submitted #364 which I think solves the issue. |
Thanks @byroot! Busy right now, but I should be able to give it a try this afternoon. Tomorrow at the latest. |
So I lied about how much free time I'd have... But I was able to test the patch this morning, and it was a success. Worked great, with or without Proxifier. Thanks to everyone for helping me out! |
Fixed via #364. |
Upgraded SSHKit this morning and found that I could no longer connect to hosts that were not in my
~/.ssh/known_hosts
file. I could downgrade and connect then upgrade again, and connecting worked just fine.The text was updated successfully, but these errors were encountered: