-
-
Notifications
You must be signed in to change notification settings - Fork 946
WIP: Implement support for rsa-sha2-256 key exchange. #971
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
Conversation
There doesn't appear to be any way to select different exchange methods depending on what the server supports for the same key, so this commit allows IPrivateKeySource to expose multiple key exchange methods for the same key and will try each one. Tested on Ubuntu 18.04 and 22.04 with default SSH server config and with only ssh-rsa and rsa-sha2-256 key exchange enabled.
Hi, I would like to know if there is any update for this one. |
when the library is going to upgrade to support sha-256 and sha-512? |
Does the solution works? I am getting "Key exchanger negotiation failed" exception. The code is never hitting RsaSha256DigitalSignature class. It always hitting RsaKey class. any reason for this? |
Same for me, does this solution work? Do i need to change used HMAC Algorithm somehow? |
A lot of people are hitting this issue. |
Yeah - add me to the list of people having problems with this. The temp workaround is to add the following two lines to the end of the /etc/ssh/sshd_config file |
@@ -10,6 +10,6 @@ public interface IPrivateKeySource | |||
/// <summary> | |||
/// Gets the host key. | |||
/// </summary> | |||
HostAlgorithm HostKey { get; } | |||
HostAlgorithm[] HostKeys { get; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This appears to be a pretty big change for the current codebase.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any guidance @darinkes ?
|
Thanks, but i dont want to change the /etc/ssh/sshd_config or maybe sometime i dont have permission to do this action. |
We will work on that in near future. |
same issue here with Kernel version 5.10.50-linux4sam-2021.04+ whilst 4.9 can connect successfully. |
Currently, we don't have pre-release packages (I know we should have them). The best option is to download the repo, checkout to the branch, add the project to the solution, and reference the project instead of Nuget. This is all for testing purposes only.
|
I can confirm that rsa-sha2 branch now works for me. Thank you very much! |
@hhklmc big thanks for checking. Thanks to it we are closer to release. 😄 |
Version 2023.0.0 has been published https://www.nuget.org/packages/SSH.NET/2023.0.0 |
There doesn't appear to be any way to select different exchange methods depending on what the server supports for the same key, so this commit allows IPrivateKeySource to expose multiple key exchange methods for the same key and will try each one.
Tested on Ubuntu 18.04 and 22.04 with default SSH server config and with only ssh-rsa and rsa-sha2-256 key exchange enabled.
Not sure if this is necessarily the best design to go with, so haven't updated the tests yet.
A simpler approach would be to just replace ssh-rsa with rsa-sha2-256, which would prevent communication with old servers (OpenSSH 7.2 added rsa-sha2-256 support in 2016).
Based on @ml054's work in #825 (comment)