0

我想连接到远程服务器以通过 SCP/SSH 上传一些文件。

我为此使用 SharpSSH,但它不起作用。

每次 ScpClint 想要连接时,我都会得到 JSchException 验证:False。

这是我的代码:

Scp scpClient = new Scp();
scpClient.To(@"C:localPath", "hostIP", "/var/...", sshUser, sshPwd);

有人对如何解决此问题有任何建议吗?也许另一个图书馆?我也试过 Renci.SshNet 但我可以连接或者它没有给出任何错误,但无论我尝试上传什么都无法在服务器上找到。

4

1 回答 1

0

Which version of the library are you using? That code is fairly old and unmaintained. My usual recommendation is to try SSHNet since that's a much more solid library, written for .NET, but you said you've already tried that. Perhaps it's a problem on the remote side if you cannot connect with either of the libraries?

于 2012-09-15T21:51:10.013 回答