vb.net - SSHAuthenticationExcetion :No suitable authentication method found to complete authentication

标签 vb.net winforms unix ssh

我正在尝试以 vb.net win 形式连接到服务器上。我放了一个按钮和一个文本区域来接收数据。但是我无法在服务器上连接。服务器是开放的,因为我可以 ping 它。

Private Sub SimpleButton1_Click(sender As System.Object, e As System.EventArgs) Handles SimpleButton1.Click
    Dim PasswordConnection = New PasswordAuthenticationMethod("username", "pass")
    Dim KeyboardInteractive = New KeyboardInteractiveAuthenticationMethod("username")
    Dim ConnectionInfo = New ConnectionInfo("server.com", 22, "username", PasswordConnection, KeyboardInteractive)

    Using client As New SshClient(ConnectionInfo)
        client.Connect()

        Dim cmd As SshCommand
        Dim result As String
        Dim result2 As String

        cmd = client.CreateCommand("who")
        cmd.CommandTimeout = TimeSpan.FromSeconds(10)
        result = cmd.Execute
        result2 = cmd.Error
        MemoEdit1.Text = cmd.ExitStatus

        If String.IsNullOrEmpty(result2) Then
            MemoEdit1.Text = result2
        End If

        MemoEdit1.Text = result

        client.Disconnect()
    End Using
End Sub

难道我做错了什么?
该程序直接停留在“client.Connect()”上。如您所见,我正在尝试连接 SimpleButton1 的事件单击

最佳答案

通常 No suitable authentication method found to complete authentication is used当服务器不允许通过客户端提供的方法进行身份验证时,从 SSH 服务器返回。

SSH 服务器只能允许公钥身份验证,或某种形式的两因素身份验证反过来阻止密码身份验证。下载 SSH 客户端,如 Putty并尝试直接连接到服务器,看看结果是什么。

关于vb.net - SSHAuthenticationExcetion :No suitable authentication method found to complete authentication,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17456903/

相关文章:

c# - iOS/MonoTouch 等同于 Windows 窗体显示/隐藏对话框?

bash - 目录检查和mv命令

shell - 在linux中查找叶目录

.net - Visual Basic 的 .Net 4.5 有哪些新功能?

C# 需要有关表单导航的简单问题的建议

asp.net - 使用 asp :ButtonField in ASP. NET 2005 以编程方式更新 GridView 中的绑定(bind)复选框

c# - ScrollWindow 完全没有效果

file - 如何读取特定行和特定位置?

arrays - 如何将字节值拆分为多个较小的字节值?

c# - 反编译的 DLL - 有助于判断它是 C# 还是 VB.NET 的线索?