Can't connect to MySQL via SSH Tunnel

raelb's profile image raelb posted 6 days ago in Creating a connection Permalink

Hi,

As per the title.

Here are my settings: image.png

image.png

I have some issue on my system with running ssh from the std command prompt. (related to 32bit / 64bit version of PowerShell), however not sure if that is the problem. That is why I entered the full path to OpenSSH ssh.exe I usually connect to server using git bash which works ok.

When I press Open, it seems to be processing the command, but returns an error:

image.png

If I set ssh.exe to C:\Program Files\Git\usr\bin\ssh.exe then I get this error: image.png

I have tried with 2 other gui's and can connect without problem.

Any ideas?

Thanks

ansgar's profile image ansgar posted 5 days ago Permalink

I suppose the second attempt failed because Git/ssh.exe has different command line options, incompatible to those passed by Heidi.

The issue with your std command prompt may be related. Please try to run cmd.exe, and the run the ssh.exe command manually, using OpenSSH.

raelb's profile image raelb posted 4 days ago Permalink

I wasn't entirely sure what you meant by "run the ssh.exe command manually, using OpenSSH". Did you mean something different to simply typing ssh into the cmd prompt?

This is the result: image.png

Anyway, I tried on another computer where ssh works fine from the command prompt, however I still get the same error when trying to connect:

image.png

Would you be willing to try to connect to the server? i.e. if you can provide a pub ssh key, I can add it to authorized_keys. This is just a test vps I am learning with on digital ocean, so I don't mind..

As mentioned, I can connect via ssh tunnel using other gui tools without a problem.

ansgar's profile image ansgar posted 3 days ago Permalink

Yes I can give it a try. You may send me needed stuff per mail (see the link on the imprint page)

raelb's profile image raelb posted 3 days ago Permalink

I did do some further investigation and found the problem was the ssh key passphrase. If I used a key with no passphrase, then I could connect without a problem. When I used a key with a passphrase, then I got the error. After I added the key to the "ssh-agent" then it worked ok as well.

So 2 suggestions:

  1. It would be helpful if the error message pointed to the fact that the issue was no/incorrect passphrase was being provided.
  2. Other programs I tried have a field for the passphrase, and they work seamlessly. Because in my case, I'm working with different ssh locations/versions, it becomes a little confusing to know which/where the ssh-agent is.

Thanks

ansgar's profile image ansgar posted 2 days ago Permalink

There were and are some issues with SSH passphrases.

  • Issue #1838 is at least related here.
  • Using ssh.exe does not prompt you for the passphrase. (plink.exe does!)

Are you using the latest HeidiSQL build?

raelb's profile image raelb posted 2 days ago Permalink

Yes, I am using the latest download of 12.8 (Portable)

Does plink work with "normal" ssh keys, i.e. generated by ssh-keygen? does plink have a different command line to ssh?

raelb's profile image raelb posted 2 days ago Permalink

Ok, I did a bit of research 🙂. So I converted the OpenSSH key to ppk format, so it could work with plink. When using plink, it does prompt for the passphrase and it does work ok.

Btw, when connecting to the server with plink using a standard cmd prompt, I get some strange behaviour: The user/location shows up twice, and some strange characters appear in the output:

image.png

HeidiSQL shows this in the enter passphrase dialog:

image.png

Please login to leave a reply, or register at first.