Skip to content
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

Prefer known algorithm for known host #721

Merged
merged 3 commits into from
Sep 23, 2021

Conversation

WorkDayHeyHey
Copy link
Contributor

(#642, #635... 10? issues)

Try to find the Algorithm that was used when a known_host
entry was created and make that the first choice for the
current connection attempt.

If the current connection algorithm matches the
algorithm used when the known_host entry was created
we can get a fair verification.

(hierynomus#642, hierynomus#635... 10? issues)

Try to find the Algorithm that was used when a known_host
entry was created and make that the first choice for the
current connection attempt.

If the current connection algorithm matches the
algorithm used when the known_host entry was created
we can get a fair verification.
@WorkDayHeyHey
Copy link
Contributor Author

I just make the changes again in a clean clone

@hierynomus
Copy link
Owner

I've changed the implementation a bit to take into account all matching hostnames in the known hosts file, instead of only the first one. It is possible to have multiple keys for the same hostname. They're now taken into account in the order that was configured in the SshConfig object.

@hierynomus hierynomus merged commit 14bf93e into hierynomus:master Sep 23, 2021
@WorkDayHeyHey
Copy link
Contributor Author

Nice! There is so much complexity in this endeavor! I'm glad I could do something useful with so little specific knowledge.

I have used Ganymede for decades, but it hasn't been maintained for a decade. I have tried other libraries too, but if there is a problem most of us are out of our depth immediately. And I guess the knowledge gap is so wide people with knowledge don't have time to provide as much support as would be needed. So having something that works is great. Long live SSHJ!

Maybe I will contribute some examples. I am building a file system tool to allow my applications to access local and remote files without having to consider which they are. I think I have all the remote methods covered and working using SSHJ. I write in Scala, but I will make some examples up in Java, that will save you and others time.

Thanks!

@hierynomus
Copy link
Owner

Good luck. We've done something like that once, have a look at https://github.com/xebialabs/overthere and https://github.com/xebialabs/nio-overthere

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants