Bitvise SSH客户端命令行(stnlc.exe)在GUI成功连接时发生错误

时间:2016-01-09 08:28:36

标签: command-line ssh ssh-tunnel

我正在将Bitvise客户端集成到我的winform应用程序中。我正在使用Bitvise SSH客户端命令行(应用程序目录中的stnlc.exe)来执行此操作。我的应用需要同时拥有多个连接。 它适用于某些地址,但其他一些地址则不然。这是我正在使用的命令:

 "C:\Program Files (x86)\Bitvise SSH Client\stnlc.exe" -profile="C:\Users\AutoOffer\AutoOffer\bin\Debug\data\sshprofile.bscp" -host=<myhost> -port=22 -user=<username> -pw=<password> -ka=y -proxyFwding=y -proxyListIntf=127.0.0.1 -proxyListPort=<port>

这就是我得到的错误:

Bitvise SSH Client 6.45 - stnlc - free for individual use only, see EULA
Copyright (C) 2000-2015 by Bitvise Limited.

Connecting to SSH2 server XX.XX.XX.XX:22.
Connection established.
Server version: SSH-2.0-dropbear_0.46
First key exchange started.
ERROR: The SSH2 session has terminated with error.
Reason: Error class: LocalSshDisconn, code: KeyExchangeFailed, message: FlowSshTransport: no mutually supported key exchange algorithm.
Local list: "ecdh-sha2-1.3.132.0.10,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie-hellman-group14-sha1".
Remote list: "diffie-hellman-group1-sha1".

我尝试通过Bitvise应用程序手动连接GUI并成功连接! 我还将我的bitvise版本更新到最新版本(6.45)。

1 个答案:

答案 0 :(得分:2)

Local list: "ecdh-sha2-1.3.132.0.10,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie-hellman-group14-sha1".
Remote list: "diffie-hellman-group1-sha1".

所以看起来远程端只支持diffie-hellman-group1-sha1,你不支持。

Bitvise SSH Server Version History上我读到了:

  

现在禁用1024位固定素数Diffie Hellman密钥交换方法diffie-hellman-group1-sha1和带Kerberos 5的gssapi-group1-sha1,由于怀疑Diffie Hellman的持续安全性为1024比特固定素数。应该通过diffie-hellman-group14-sha1方法保留与大多数旧客户端的兼容性,该方法使用2048位固定素数。我们建议将旧的SSH客户端迁移到支持ECDH和ECDSA的新版本。

所以看起来你必须修改设置并允许1024位固定素数Diffie Hellman密钥交换方法。否则你将无法连接。如上所述,更改ssh服务器设置当然更好。