Uh oh!
There was an error while loading. Please reload this page.
WIP: Implement support for rsa-sha2-256 key exchange. - #971
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.
johnliaoywl
commented
Dec 7, 2022
Hi, I would like to know if there is any update for this one. |
lcheng526
commented
Jan 24, 2023
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? |
maxx8888
commented
Feb 8, 2023
Same for me, does this solution work? Do i need to change used HMAC Algorithm somehow? |
darkoperator
commented
Apr 2, 2023
A lot of people are hitting this issue. |
mikeblas
commented
May 15, 2023
ckdell
commented
Jun 27, 2023
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 |
et1975
commented
Aug 3, 2023
| /// Gets the host key. | ||
| /// </summary> | ||
| HostAlgorithm HostKey { get; } | ||
| HostAlgorithm[] HostKeys { get; } |
There was a problem hiding this comment.
This appears to be a pretty big change for the current codebase.
phamvietdung
commented
Sep 8, 2023
Videstra
commented
Sep 8, 2023
|
Thanks, but i dont want to change the /etc/ssh/sshd_config or maybe sometime i dont have permission to do this action. |
WojciechNagorski
commented
Sep 8, 2023
We will work on that in near future. |
hhklmc
commented
Sep 19, 2023
same issue here with Kernel version 5.10.50-linux4sam-2021.04+ whilst 4.9 can connect successfully. |
WojciechNagorski
commented
Sep 19, 2023
hhklmc
commented
Sep 19, 2023
WojciechNagorski
commented
Sep 19, 2023
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. |
hhklmc
commented
Sep 20, 2023
I can confirm that rsa-sha2 branch now works for me. Thank you very much! |
WojciechNagorski
commented
Sep 20, 2023
@hhklmc big thanks for checking. Thanks to it we are closer to release. 😄 |
WojciechNagorski
commented
Sep 23, 2023
WojciechNagorski
commented
Oct 10, 2023
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)