Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vb.net 由于错误,Renci.SshNet无法连接_Vb.net_Ssh_Ssh.net - Fatal编程技术网

Vb.net 由于错误,Renci.SshNet无法连接

Vb.net 由于错误,Renci.SshNet无法连接,vb.net,ssh,ssh.net,Vb.net,Ssh,Ssh.net,我有以下简单的代码,但不起作用: Imports Renci.SshNet Public Class ClassTriggerSender Public Sub SendTrigger() Dim connInfo As New Renci.SshNet.PasswordConnectionInfo("172.20.47.72", "developer", "developer") Dim sshClient As New Renci.SshNet

我有以下简单的代码,但不起作用:

Imports Renci.SshNet

Public Class ClassTriggerSender

    Public Sub SendTrigger()

        Dim connInfo As New Renci.SshNet.PasswordConnectionInfo("172.20.47.72", "developer", "developer")

        Dim sshClient As New Renci.SshNet.SshClient(connInfo)

        Dim cmd As Renci.SshNet.SshCommand

        sshClient.Connect()

        cmd = sshClient.RunCommand("dir")

        Console.WriteLine(cmd.Result)

        sshClient.Disconnect()

    End Sub

End Class
我的目标是简单地发送SSH命令以在linux shell上执行命令

这是错误消息:

我在堆栈溢出上发现了以下内容:

但是,使用此代码,我得到了一个类似的错误:

请帮忙


谢谢

对我来说,这是一种工作方法

Dim ssh As Renci.SshNet.SshClient
ssh = New SshClient(host, port, username, password)
    Try
        ssh.Connect()
        ssh.RunCommand(script)
    Catch ex As Exception

    End Try

向我们显示来自能够使用相同凭据进行身份验证的任何SSH客户端的日志文件。