SSH failing when using Password Authentication

SSH failing when using Password Authentication

Postby KeithAlpha » Mon 16 Aug 2010 13:02


I'm interested in using Devart's dotConnect for MySQL to establish an SSH tunnel to a FreeBSD 7.0 machine and securely access the MySQL database over the encrypted tunnel.

I'm having difficulties using the Password Authentication method. I get the error "Can't connect to SSH server on 'ip address': User authentication failed." Here is the code I'm using:

Code: Select all
        Dim myConn As MySqlConnection = New MySqlConnection("host=localhost;protocol=SSH;user=root;password=password;database=database;")

        myConn.Protocol = MySqlProtocol.Ssh
        myConn.SshOptions.AuthenticationType = SshAuthenticationType.Password
        myConn.SshOptions.Port = 22
        myConn.SshOptions.Host = "" 'external address for SSH
        myConn.SshOptions.User = "root" 'sshuser
        myConn.SshOptions.Password = "" 'ssh password

        Dim myCommand As MySqlCommand = New MySqlCommand("select count(*) from USER", myConn)
        Dim count As Int64 = Convert.ToInt64(myCommand.ExecuteScalar())

Firewalls are not an issue, I can use putty and access the server via SSH username/password.

Any clues as to what I may be doing wrong?
I'm using dotConnect for MySQL version
Posts: 1
Joined: Mon 16 Aug 2010 12:33

Postby Shalex » Wed 18 Aug 2010 12:34

I have just checked the 5.80.152 and 6.0.10 versions of dotConnect for MySQL: connection was successful with the code you have specified. The only way to reproduce the error in our environment is to specify invalid myConn.SshOptions.User or myConn.SshOptions.Password.

Please check your credentials again. For example, you can do that using command line:
ssh userName@hostName.
Devart Team
Posts: 7282
Joined: Thu 14 Aug 2008 12:44

Return to dotConnect for MySQL