SSHAuthenticationExcetion :找不到合适的身份验证方法来完成身份验证 [英] SSHAuthenticationExcetion :No suitable authentication method found to complete authentication

查看:33
本文介绍了SSHAuthenticationExcetion :找不到合适的身份验证方法来完成身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm trying to connect on a server in vb.net win forms. I put a button and a text area to receive the data. But I'm unable to connect on the server. The server is open because i can ping it.

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 的事件点击

Am I doing something wrong?
The program stuck directly on the "client.Connect()". As you can see im trying to connect on the event click of SimpleButton1

推荐答案

通常 没有找到合适的身份验证方法来完成身份验证 当服务器不允许由 SSH 服务器进行身份验证时,会从该服务器返回客户提供的方法.

Normally No suitable authentication method found to complete authentication is used is returned from an SSH server when the server does not allow authentication by the offered methods by the client.

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

The SSH server could only allow public key authentication, or some form of two factor authentication in turn preventing password authentication. Download an SSH client like Putty and try to connect to the server directly and see what the result is.

这篇关于SSHAuthenticationExcetion :找不到合适的身份验证方法来完成身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆