C# Renci SshNet 服务器响应在位置 0x0000002A 包含一个空字符

C# Renci SshNet The server response contains a null character at position 0x0000002A

我有多个 Raspberries 运行 SSH 服务器: (OpenSSH_7.4p1 Raspbian-10+deb9u7,OpenSSL 1.0.2u 2019 年 12 月 20 日)。 如果我尝试通过 Renci SshNet 连接,我会收到以下错误消息:

Renci.SshNet.Common.SshConnectionException: "The server response contains a null character at position 0x0000002A:

00000000 53 53 48 2D 32 2E 30 2D 4F 70 65 6E 53 53 48 5F SSH-2.0-OpenSSH_ 00000010 37 2E 34 70 31 20 52 61 73 70 62 69 61 6E 2D 31 7.4p1 Raspbian-1 00000020 30 2B 64 65 62 39 75 37 0A 00
0+deb9u7..

A server must not send a null character before the Protocol Version Exchange is complete.

More information is available here: https://www.rfc-editor.org/rfc/rfc4253#section-4.2"

SshClient scClient = new SshClient("123.123.123.123", "pi", "raspberry");
scClient.Connect();

是否可以更改 ssh 服务器的行为, 甚至更好;我可以告诉 renci ssh 忽略这些协议错误吗?

我认为这是最新 SSH.NET NuGet 包的问题。目前最新的是2020.0.0。而之前的那个是 2020.0.0-beta1.

2020.0.0 给我这个问题,2020.0.0-beta1 没有。

我会在 https://github.com/sshnet/SSH.NET/issues

上报告这个问题

编辑:

2020.0.1 刚刚发布。那个好像没有这个问题。我推荐你试试那个版本。