我尝试通过ssh与树莓派连接,但不幸的是,我收到此错误消息。我尝试像本主题一样使用try-catch,Renci.SshNet : "server response does not contain ssh protocol identification"但这无济于事。当我尝试通过linux上的ssh.client与该设备连接时,一切都能正常工作,因此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.'