【发布时间】:2012-07-27 07:29:37
【问题描述】:
我制作了一个应用程序,它使用 SSH 连接连接到设备,就像我们使用 PUTTY 软件一样。 在我的应用程序中,我使用了 Tamir.sharpSsh C# 库。它在建立 SSH 连接时出现异常。我不知道这是库或设备响应的问题还是其他问题。
下面是代码。
using Tamir.SharpSsh;
var obj = new SshStream(ip, username, password); // exception here
obj.Write("ls -a");
string rS = obj.ReadResponse();
richTextBox.Text = rS;
这里是例外
Exception : System.IO.IOException
at Tamir.SharpSsh.jsch.Session.connect(Int32 connectTimeout)
at Tamir.SharpSsh.jsch.Session.connect()
at Tamir.SharpSsh.SshStream..ctor(String host, String username, String password)
如果需要,我也可以提供 Wireshark 数据。
【问题讨论】:
标签: c# networking ssh client-server sharpssh