Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No Passphrase Popup, when using ssh tunnel. #1940

Closed
Bastika07 opened this issue Apr 16, 2024 · 8 comments
Closed

No Passphrase Popup, when using ssh tunnel. #1940

Bastika07 opened this issue Apr 16, 2024 · 8 comments

Comments

@Bastika07
Copy link

Preconditions

  • HeidiSQL version: 12.6.0.6765
  • Database type and version: MariaDB 10.5.23
  • OS: Win11 23H2

Describe the bug

If i am using a ssh key with a passphrase, and usind ssh.exe for the tunnel, i just get can´t connect. With plink.exe i get a popup for the ssh password, but not the passphrase.
Using it with the same ssh key, without a passphrase, it is working without any problems.
To Reproduce

Screenshots or Crash reports

Screenshot 2024-04-16 145606
Screenshot 2024-04-16 145816
plink.exe -ssh root@x.x.x.x -P 22 -i "C:\Users\xxx.ssh\id_rsa" -N -L 3307:127.0.0.1:3306

@Bastika07
Copy link
Author

2024-04-16 15:07:44 [passphrase] / / [15:07:44.714] ssh.exe root@x.x.x.x-p 22 -i "C:\Users\xxx.ssh\id_rsa" -N -L 3307:127.0.0.1:3306 /
/
2024-04-16 15:07:50 [passphrase] / / [15:07:50.852] Can't connect to server on '127.0.0.1' (10061) /
/
2024-04-16 15:07:50 [passphrase] / / [15:07:50.853] Schließe SSH-Prozess #255

@Bastika07
Copy link
Author

If i try the ssh command in my commandline, i will be asked for my passphrase.

@ansgarbecker
Copy link
Collaborator

ansgarbecker commented Apr 16, 2024

I was just trying to reproduce on poweshell terminal, and ssh.exe prompts for my passphrase - so far so correct. After I entered the correct passphrase, I get a waiting cursor, and nothing happens for at least 20 seconds:

grafik

What's happening there?

Edit: forget this, I was expecting some output but started a tunnel which does not output anything, so the connection was successful.

@ansgarbecker
Copy link
Collaborator

Problem seems to lie somewhere in my TProcessPipe and TSecureShellCmd implementation. The output saying "Enter passphrase for key ...:" is not visible in the out pipe, for some reason.

@ansgarbecker
Copy link
Collaborator

Related: #1838

@ansgarbecker
Copy link
Collaborator

I just tried with plink.exe and I was asked for the passphrase:

grafik

Note that plink/putty uses a different key format, so I had to convert my OpenSSH key with puttygen.exe to the format which plink accepts. Withouth that, plink is returning a "Unable to use key file" error (invisible in HeidiSQL), and asks for the users password.

@ansgarbecker
Copy link
Collaborator

Next build shows potential errors in the dialog and in the log panel, like the one you get when using plink with a OpenSSH key:

grafik

@ansgarbecker
Copy link
Collaborator

Solution is to use plink witha putty key if you want to use keys with a passphrase. HeidiSQL then prompts you for the passphrase.

Using ssh.exe, it seems impossible to catch the "Enter passphrase" prompt from the internal process.

@ansgarbecker ansgarbecker added this to the v12.7 milestone Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants