SSHAuthenticationExcetion :No suitable authentication method found to complete authentication

15,775

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.

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.

Share:
15,775

Related videos on Youtube

JoSav
Author by

JoSav

Updated on June 04, 2022

Comments

  • JoSav
    JoSav over 1 year

    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
    

    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

    • Steven V
      Steven V over 10 years
      Does the SSH server allow keyboard/password authentication?
    • JoSav
      JoSav over 10 years
      I ussualy use this code before but having the same problem: Using client As New SshClient("server.com", 22, "username", "pass")
    • JoSav
      JoSav over 10 years
      I dont know if the server allor that type of authentication...
    • Russell Uhl
      Russell Uhl over 10 years
      you can ping all you like. the question is, can you telnet to port 22?
    • Steven V
      Steven V over 10 years
      Normally No suitable authentication method found to complete authentication is used by an SSH server when the server does not allow authentication by the offered methods by the client. 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 and see what the result is.
    • JoSav
      JoSav over 10 years
      you was right guys i cannot connect using telnet and putty cause the person who asked me to do this application send me the wrong server. I'm sorry to waste your times guys. And Steven if you could write your last comment like an answer I'll could close this question. With the good server everything work,
  • JoSav
    JoSav over 10 years
    you are i cannot connect using telnet and putty cause the person who asked me to do this application send me the wrong server. With the good server everything work