gpt4 book ai didi

c# - SshConnectionException : 'Server response does not contain SSH protocol identification.'

转载 作者:太空宇宙 更新时间:2023-11-03 12:08:06 26 4
gpt4 key购买 nike

我尝试通过 ssh 连接 raspberry pi,但不幸的是我收到此错误消息。我尝试像本主题中那样使用 try-catch,Renci.SshNet : "server response does not contain ssh protocol identification"但它没有帮助。当我尝试在 linux 上通过 ssh.client 连接这个设备时,everythink 工作,所以 IP 和端口都很好。我在 Visual Studio 上工作,我使用 Xamarin.forms。

我的代码:

using (var client = new SshClient("11.15.16.385", 24, "root", "password"))
{
client.Connect();
client.RunCommand("reboot");
client.Disconnect();
}

结果:

Error in client.connect():

Renci.SshNet.Common.SshConnectionException: 'Server response does not
contain SSH protocol identification.'

最佳答案

这可能是由您的树莓派发送的响应引起的,您可以从 source code 中看到.它可能缺少版本信息。

关于c# - SshConnectionException : 'Server response does not contain SSH protocol identification.' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53851602/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com