plink.exe wrong passphrase

carloscastaneda's profile image carloscastaneda posted 2 years ago in HeidiSQL portable Permalink

Sometimes it happens that HeidiSQL reports a plink.exe wrong passphrase with a Dialog Box immediately after entering the passphrase for the imported openSSH key.

Dispite to this message there is a session and it is working! The correspondig sessionlog file contains the plink.exe commandline, but there is no hint with regard to the error mesage in the dialog box.

1 attachment(s):
  • HeidiSQL-plink-fehler-2022-10-19-1233
ansgar's profile image ansgar posted 2 years ago Permalink

Strange. If the passphrase was wrong, then there shouldn't be a session running afterwards.

And you typed a passphrase into the prompt before?

carloscastaneda's profile image carloscastaneda posted 2 years ago Permalink

Yes,i did. The passphrase is not wrong, because there is a valid session. The message is wrong, whysoever. As a test I launched HeidiSQL an entered a wrong passphrase. Doing so I'm entering into a passphrase loop until I enter the correct one. If it helps I can provide the Screenshot of wrong passphrase window and the corresponding session logs. Is there an option to augment the tracing/verbositylevel?

carloscastaneda's profile image carloscastaneda posted 1 year ago Permalink

Today I enabled all logging options and recorded the following and as you can see there is a wrong passphrase message but the session is active:

/* 2022-10-26 11:01:34 [] */ /* Delimiter eingestellt auf ; */
/* 2022-10-26 11:01:34 [] */ /* Setting up TSynMemo "SynMemoQuery" */
/* 2022-10-26 11:01:34 [] */ /* Setting up TSynMemo "SynMemoFilter" */
/* 2022-10-26 11:01:34 [] */ /* Setting up TSynMemo "SynMemoProcessView" */
/* 2022-10-26 11:01:34 [] */ /* Setting up TSynMemo "SynMemoSQLLog" */
/* 2022-10-26 11:01:34 [] */ /* Schreibe ab jetzt in Sitzungs Logdatei: I:\portableapps.com\otherportableApps\HeidiSQL_12.1_64_Portable\SessionLogs\000022.log */
/* 2022-10-26 11:01:34 [] */ /* Setting up TSynMemo "SynMemoQuery" */
/* 2022-10-26 11:01:34 [] */ /* Setting up TSynMemo "SynMemoFilter" */
/* 2022-10-26 11:01:34 [] */ /* Setting up TSynMemo "SynMemoProcessView" */
/* 2022-10-26 11:01:34 [] */ /* Setting up TSynMemo "SynMemoSQLLog" */
/* 2022-10-26 11:01:34 [] */ /* Pfad zur Anwendung: "I:\portableapps.com\otherportableApps\HeidiSQL_12.1_64_Portable\heidisql.exe" */
/* 2022-10-26 11:01:34 [] */ /* Version: "12.1.0.6537" */
/* 2022-10-26 11:01:34 [] */ /* Theme: "Windows" */
/* 2022-10-26 11:01:34 [] */ /* Pixel pro Zoll auf aktuellem Bildschirm: 96 */
/* 2022-10-26 11:01:34 [] */ /* Timezone offset: -7200 */
/* 2022-10-26 11:01:48 [nextcloudpi lokal] */ /* Lade Bibliothek Datei I:\portableapps.com\otherportableApps\HeidiSQL_12.1_64_Portable\libmariadb.dll ... */
/* 2022-10-26 11:01:48 [nextcloudpi lokal] */ /* I:\portableapps.com\otherportableApps\HeidiSQL_12.1_64_Portable\libmariadb.dll v3.2.5 loaded. */
/* 2022-10-26 11:01:52 [nextcloudpi lokal] */ /* Verbindung zu localhost über MariaDB or MySQL (SSH tunnel), Benutzername xxxxxxxxx_db, benutze Passwort: Yes ... */
/* 2022-10-26 11:01:55 [nextcloudpi lokal] */ /* Versuche SSH Prozess zu starten, warte 4s auf Antwort ... */
/* 2022-10-26 11:01:55 [nextcloudpi lokal] */ /* plink.exe -ssh pi@nextcloudpi -P 22 -i "I:\portableapps.com\PortableApps\WinSCPPortable\Data\xxxxxxxxx.ppk" -N -L 3307:localhost:3306 */
/* 2022-10-26 11:01:55 [nextcloudpi lokal] */ /* SSH output after 400 ms. OutPipe: ""  ErrorPipe: "Using username "xxxxx".
" */
/* 2022-10-26 11:01:55 [nextcloudpi lokal] */ /* SSH: Using username "xxxxx".
 */
/* 2022-10-26 11:01:56 [nextcloudpi lokal] */ /* SSH output after 600 ms. OutPipe: "Passphrase for key "imported-openssh-key": 
Passphrase for key "imported-openssh-key":"  ErrorPipe: "Wrong passphrase
" */
/* 2022-10-26 11:02:37 [nextcloudpi lokal] */ /* Ping server ... */
/* 2022-10-26 11:02:37 [nextcloudpi lokal] */ /* Ping server ... */
/* 2022-10-26 11:02:37 [nextcloudpi lokal] */ /* Ping server ... */
/* 2022-10-26 11:02:37 [nextcloudpi lokal] */ SELECT CONNECTION_ID();
/* 2022-10-26 11:02:37 [nextcloudpi lokal] */ /* Result #1 fetched. */
/* 2022-10-26 11:02:37 [nextcloudpi lokal] */ /* Detected column type for CONNECTION_ID() (3): INT */
/* 2022-10-26 11:02:37 [nextcloudpi lokal] */ /* Ping server ... */
/* 2022-10-26 11:02:37 [nextcloudpi lokal] */ SHOW VARIABLES;
/* 2022-10-26 11:02:37 [nextcloudpi lokal] */ /* Result #1 fetched. */
/* 2022-10-26 11:02:37 [nextcloudpi lokal] */ /* Detected column type for Variable_name (253): VARCHAR */
/* 2022-10-26 11:02:37 [nextcloudpi lokal] */ /* Detected column type for Value (253): VARCHAR */
/* 2022-10-26 11:02:37 [nextcloudpi lokal] */ /* Zeichensatz: utf8mb4 */
/* 2022-10-26 11:02:37 [nextcloudpi lokal] */ /* Ping server ... */
/* 2022-10-26 11:02:37 [nextcloudpi lokal] */ SHOW /*!50002 GLOBAL */ STATUS;
/* 2022-10-26 11:02:37 [nextcloudpi lokal] */ /* Result #1 fetched. */
/* 2022-10-26 11:02:37 [nextcloudpi lokal] */ /* Detected column type for Variable_name (253): VARCHAR */
/* 2022-10-26 11:02:37 [nextcloudpi lokal] */ /* Detected column type for Value (253): VARCHAR */
/* 2022-10-26 11:02:37 [nextcloudpi lokal] */ /* Ping server ... */
/* 2022-10-26 11:02:37 [nextcloudpi lokal] */ SELECT NOW();
/* 2022-10-26 11:02:37 [nextcloudpi lokal] */ /* Result #1 fetched. */
/* 2022-10-26 11:02:37 [nextcloudpi lokal] */ /* Detected column type for NOW() (12): DATETIME */
/* 2022-10-26 11:02:37 [nextcloudpi lokal] */ /* SetDatabase(), FDatabase:  */
/* 2022-10-26 11:02:37 [nextcloudpi lokal] */ /* Verbunden. Prozess-ID: 6765 */
ansgar's profile image ansgar posted 1 year ago Permalink

Probably the passphrase is routed wrong from HeidiSQL's input box to the plink process. Are you using the shipped plink binary? Should be v0.75

You could try the Windows internal ssh.exe in the "SSH executable" box. Since you're using a key instead of a password, that should work out of the box. Crossing fingers the key file is compatible.

carloscastaneda's profile image carloscastaneda posted 1 year ago Permalink

I selected plink.exe on SSH Tunnel Tab. I suppose then the plink HeidiSQL home directory is used:

& I:\portableapps.com\otherportableApps\HeidiSQL_12.1_64_Portable\plink --version
plink: Release 0.75
Build platform: 64-bit x86 Windows
Compiler: clang 12.0.0 (https://github.com/llvm/llvm-project/ d28af7c654d8db0b68c175db5ce212d74fb5e9bc), emulating Visual Studio 2013 (12.0), _MSC_VER=1800
Source commit: c72200ff8851b0d95574b8a8a88a2780a243c66c
carloscastaneda's profile image carloscastaneda posted 1 year ago Permalink

Unfortunatly it does not work with ssh.exe, even if I followed the recommendations in Connecting to a server:

/* 2022-10-26 12:31:07 [nextcloudpi lokal] */ /* Lade Bibliothek Datei I:\portableapps.com\otherportableApps\HeidiSQL_12.1_64_Portable\libmariadb.dll ... */
/* 2022-10-26 12:31:07 [nextcloudpi lokal] */ /* I:\portableapps.com\otherportableApps\HeidiSQL_12.1_64_Portable\libmariadb.dll v3.2.5 loaded. */
/* 2022-10-26 12:31:11 [nextcloudpi lokal] */ /* Verbindung zu 127.0.0.1 über MariaDB or MySQL (SSH tunnel), Benutzername xxxxxxxxx_db, benutze Passwort: Yes ... */
/* 2022-10-26 12:31:13 [nextcloudpi lokal] */ /* Versuche SSH Prozess zu starten, warte 4s auf Antwort ... */
/* 2022-10-26 12:31:13 [nextcloudpi lokal] */ /* ssh.exe pi@nextcloudpi -p 22 -i "C:\Users\XXXXXXXXXX\.ssh\id_ecdsa" -N -L 3307:127.0.0.1:3306 */
/* 2022-10-26 12:31:20 [nextcloudpi lokal] */ /* Can't connect to server on '127.0.0.1' (10061) */
/* 2022-10-26 12:31:20 [nextcloudpi lokal] */ /* Schließe SSH Prozess #2280 */
carloscastaneda's profile image carloscastaneda posted 1 year ago Permalink

I just ran and noticed the message (see bold text below: "Access granted. Press Return to begin session.") after entering the key. I had to press the Return key. May be the that's the message text that should be returned instead of "Wrong passphrase"!

The following command has been taken from the session log.

& I:\portableapps.com\otherportableApps\HeidiSQL_12.1_64_Portable\plink.exe -ssh pi@nextcloudpi -P 22 -i "I:\portableapps.com\PortableApps\WinSCPPortable\Data\xxxxxxx.ppk" -N -L 3308:localhost:3306
Using username "pi".
Passphrase for key "imported-openssh-key":
**Access granted. Press Return to begin session.**
ansgar's profile image ansgar posted 1 year ago Permalink

Exactly, that should happen, instead of "wrong passphrase". Question is why plink does not accept the passphrase you are entering in the dialog.

ansgar's profile image ansgar posted 1 year ago Permalink

Oh I just see the "wrong passphrase" message comes along at the same time when the prompt comes in:

/* SSH: Using username "xxxxx". */
/* SSH output after 600 ms. OutPipe: "Passphrase for key "imported-openssh-key": 
Passphrase for key "imported-openssh-key":"  ErrorPipe: "Wrong passphrase" */
/* Ping server ... */

Does that mean HeidiSQL does not prompt you for the passphrase?

ansgar's profile image ansgar posted 1 year ago Permalink

Please also testwise increase the "SSH timeout" in the session setting, to 20s.

carloscastaneda's profile image carloscastaneda posted 1 year ago Permalink

Exactly, that should happen, instead of "wrong passphrase". Question is why plink does not accept the passphrase you are entering in the dialog.

The passphrase is accepted and a sessions is being established and working. That's the weird thing

carloscastaneda's profile image carloscastaneda posted 1 year ago Permalink

Oh I just see the "wrong passphrase" message comes along at the same time when the prompt comes in:

/* SSH: Using username "xxxxx". */
/* SSH output after 600 ms. OutPipe: "Passphrase for key "imported-openssh-key": 
Passphrase for key "imported-openssh-key":"  ErrorPipe: "Wrong passphrase" */
/* Ping server ... */

Does that mean HeidiSQL does not prompt you for the passphrase?

No, HeidiSQL is prompting for the database and plink password/passphrase in this sequence.

carloscastaneda's profile image carloscastaneda posted 1 year ago Permalink

Please also testwise increase the "SSH timeout" in the session setting, to 20s.

Hhmmm, now it seems to work... no more wrong passphrase message. :-)

/* 2022-10-27 10:07:53 [nextcloudpi lokal] */ /* Lade Bibliothek Datei I:\portableapps.com\otherportableApps\HeidiSQL_12.1_64_Portable\libmariadb.dll ... */
/* 2022-10-27 10:07:54 [nextcloudpi lokal] */ /* I:\portableapps.com\otherportableApps\HeidiSQL_12.1_64_Portable\libmariadb.dll v3.2.5 loaded. */
/* 2022-10-27 10:07:59 [nextcloudpi lokal] */ /* Verbindung zu localhost über MariaDB or MySQL (SSH tunnel), Benutzername xxxxxxx_db, benutze Passwort: Yes ... */
/* 2022-10-27 10:08:01 [nextcloudpi lokal] */ /* Versuche SSH Prozess zu starten, warte 20s auf Antwort ... */
/* 2022-10-27 10:08:01 [nextcloudpi lokal] */ /* plink.exe -ssh pi@nextcloudpi -P 22 -i "I:\portableapps.com\PortableApps\WinSCPPortable\Data\xxxxxxx.ppk" -N -L 3307:localhost:3306 */
/* 2022-10-27 10:08:02 [nextcloudpi lokal] */ /* SSH output after 800 ms. OutPipe: "Passphrase for key "imported-openssh-key":"  ErrorPipe: "Using username "pi".
" */
/* 2022-10-27 10:08:07 [nextcloudpi lokal] */ /* SSH: Using username "pi".
 */
/* 2022-10-27 10:08:26 [nextcloudpi lokal] */ /* Ping server ... */
/* 2022-10-27 10:08:26 [nextcloudpi lokal] */ /* Ping server ... */
/* 2022-10-27 10:08:26 [nextcloudpi lokal] */ /* Ping server ... */
/* 2022-10-27 10:08:26 [nextcloudpi lokal] */ SELECT CONNECTION_ID();
carloscastaneda's profile image carloscastaneda posted 1 year ago Permalink

Nope. Just opened HeidiSQL again and despite the 20 sec wait time message box "Wrong passphrase" appeared again. See excerpt of session log :-(

/* 2022-10-27 16:31:17 [nextcloudpi lokal] */ /* Lade Bibliothek Datei I:\portableapps.com\otherportableApps\HeidiSQL_12.1_64_Portable\libmariadb.dll ... */
/* 2022-10-27 16:31:17 [nextcloudpi lokal] */ /* I:\portableapps.com\otherportableApps\HeidiSQL_12.1_64_Portable\libmariadb.dll v3.2.5 loaded. */
/* 2022-10-27 16:31:21 [nextcloudpi lokal] */ /* Verbindung zu localhost über MariaDB or MySQL (SSH tunnel), Benutzername xxxxxxx_db, benutze Passwort: Yes ... */
/* 2022-10-27 16:31:23 [nextcloudpi lokal] */ /* Versuche SSH Prozess zu starten, warte 20s auf Antwort ... */
/* 2022-10-27 16:31:23 [nextcloudpi lokal] */ /* plink.exe -ssh pi@nextcloudpi -P 22 -i "I:\portableapps.com\PortableApps\WinSCPPortable\Data\xxxxxxx.ppk" -N -L 3307:localhost:3306 */
/* 2022-10-27 16:31:24 [nextcloudpi lokal] */ /* SSH output after 400 ms. OutPipe: ""  ErrorPipe: "Using username "pi".
" */
/* 2022-10-27 16:31:24 [nextcloudpi lokal] */ /* SSH: Using username "pi".
 */
/* 2022-10-27 16:31:24 [nextcloudpi lokal] */ /* SSH output after 600 ms. OutPipe: "Passphrase for key "imported-openssh-key": 
Passphrase for key "imported-openssh-key":"  ErrorPipe: "Wrong passphrase
" */
/* 2022-10-27 16:31:50 [nextcloudpi lokal] */ /* Ping server ... */
/* 2022-10-27 16:31:50 [nextcloudpi lokal] */ /* Ping server ... */
/* 2022-10-27 16:31:50 [nextcloudpi lokal] */ /* Ping server ... */
/* 2022-10-27 16:31:50 [nextcloudpi lokal] */ SELECT CONNECTION_ID();
Code modification/commit 9b68360 from Ansgar Becker <anse@heidisql.com>, 1 year ago, revision 12.1.0.6563
SSH tunnel: process error pipe contents only if std pipe is empty. See https://www.heidisql.com/forum.php?t=39851
ansgar's profile image ansgar posted 1 year ago Permalink

Next build processes the error pipe only when there was no normal output in the ssh process. I suspect the error "wrong passphrase" happens before the prompt happens. In such cases the error message can be ignored.

Please update to the next build r6563 (should be available in one hour)

ansgar's profile image ansgar posted 1 year ago Permalink

@carloscastaneda did you have a chance to test the modifications in the latest build?

carloscastaneda's profile image carloscastaneda posted 1 year ago Permalink

Sorry, I didn't realize your post. If I follow the link I get the source code difference. Is there a binary for the build? That would be great!

carloscastaneda's profile image carloscastaneda posted 1 year ago Permalink

I got it :-)

carloscastaneda's profile image carloscastaneda posted 1 year ago Permalink

@carloscastaneda did you have a chance to test the modifications in the latest build?

I have downloaded both r6563 and r6565. I ran both builds twice, with r6565 there was one occurrence of "Wrong Passphrase" in the second session log (none in the first) and with r6563 the message occurred in both session logs. But there was no message box in either build execution.

/* 2022-11-03 17:54:02 [] */ /* Pfad zur Anwendung: "I:\portableapps.com\otherportableApps\HeidiSQL_12.1_64_Portable\heidisql64.r6563.exe" */
/* 2022-11-03 17:54:02 [] */ /* Version: "12.1.0.6563" */
/* 2022-11-03 17:54:02 [] */ /* Theme: "Windows" */
/* 2022-11-03 17:54:02 [] */ /* Pixel pro Zoll auf aktuellem Bildschirm: 96 */
/* 2022-11-03 17:54:02 [] */ /* Timezone offset: -3600 */
/* 2022-11-03 17:54:05 [nextcloudpi lokal] */ /* Lade Bibliothek Datei I:\portableapps.com\otherportableApps\HeidiSQL_12.1_64_Portable\libmariadb.dll ... */
/* 2022-11-03 17:54:05 [nextcloudpi lokal] */ /* I:\portableapps.com\otherportableApps\HeidiSQL_12.1_64_Portable\libmariadb.dll v3.2.5 loaded. */
/* 2022-11-03 17:54:09 [nextcloudpi lokal] */ /* Verbindung zu localhost über MariaDB or MySQL (SSH tunnel), Benutzername xxxxxxx_db, benutze Passwort: Yes ... */
/* 2022-11-03 17:54:11 [nextcloudpi lokal] */ /* Versuche SSH Prozess zu starten, warte 20s auf Antwort ... */
/* 2022-11-03 17:54:11 [nextcloudpi lokal] */ /* I:\portableapps.com\PortableApps\PuTTYPortable\App\putty\PLINK.EXE -ssh pi@nextcloudpi -P 22 -i "I:\portableapps.com\PortableApps\WinSCPPortable\Data\xxxxxxx.ppk" -N -L 3307:localhost:3306 */
/* 2022-11-03 17:54:12 [nextcloudpi lokal] */ /* SSH output after 400 ms. OutPipe: ""  ErrorPipe: "Using username "pi".
" */
/* 2022-11-03 17:54:12 [nextcloudpi lokal] */ /* SSH: Using username "pi".
 */
/* 2022-11-03 17:54:12 [nextcloudpi lokal] */ /* SSH output after 600 ms. OutPipe: "Passphrase for key "imported-openssh-key": 
Passphrase for key "imported-openssh-key":"  ErrorPipe: "Wrong passphrase
" */
/* 2022-11-03 17:54:36 [nextcloudpi lokal] */ /* Ping server ... */

I also entered the ssh password incorrectly 2 times and then a message box came up with 2 lines of "Wrong passphrase".

/* 2022-11-03 18:03:05 [] */ /* Pfad zur Anwendung: "I:\portableapps.com\otherportableApps\HeidiSQL_12.1_64_Portable\heidisql64.r6563.exe" */
/* 2022-11-03 18:03:05 [] */ /* Version: "12.1.0.6563" */
/* 2022-11-03 18:03:05 [] */ /* Theme: "Windows" */
/* 2022-11-03 18:03:05 [] */ /* Pixel pro Zoll auf aktuellem Bildschirm: 96 */
/* 2022-11-03 18:03:05 [] */ /* Timezone offset: -3600 */
/* 2022-11-03 18:03:08 [nextcloudpi lokal] */ /* Lade Bibliothek Datei I:\portableapps.com\otherportableApps\HeidiSQL_12.1_64_Portable\libmariadb.dll ... */
/* 2022-11-03 18:03:08 [nextcloudpi lokal] */ /* I:\portableapps.com\otherportableApps\HeidiSQL_12.1_64_Portable\libmariadb.dll v3.2.5 loaded. */
/* 2022-11-03 18:03:11 [nextcloudpi lokal] */ /* Verbindung zu localhost über MariaDB or MySQL (SSH tunnel), Benutzername xxxxxxx_db, benutze Passwort: Yes ... */
/* 2022-11-03 18:03:13 [nextcloudpi lokal] */ /* Versuche SSH Prozess zu starten, warte 20s auf Antwort ... */
/* 2022-11-03 18:03:13 [nextcloudpi lokal] */ /* I:\portableapps.com\PortableApps\PuTTYPortable\App\putty\PLINK.EXE -ssh pi@nextcloudpi -P 22 -i "I:\portableapps.com\PortableApps\WinSCPPortable\Data\xxxxxxx.ppk" -N -L 3307:localhost:3306 */
/* 2022-11-03 18:03:14 [nextcloudpi lokal] */ /* SSH output after 400 ms. OutPipe: ""  ErrorPipe: "Using username "pi".
" */
/* 2022-11-03 18:03:14 [nextcloudpi lokal] */ /* SSH: Using username "pi".
 */
/* 2022-11-03 18:03:14 [nextcloudpi lokal] */ /* SSH output after 600 ms. OutPipe: "Passphrase for key "imported-openssh-key": 
Passphrase for key "imported-openssh-key":"  ErrorPipe: "Wrong passphrase
" */
/* 2022-11-03 18:03:17 [nextcloudpi lokal] */ /* SSH output after 800 ms. OutPipe: "Passphrase for key "imported-openssh-key":"  ErrorPipe: "" */
/* 2022-11-03 18:03:22 [nextcloudpi lokal] */ /* SSH output after 1000 ms. OutPipe: "Passphrase for key "imported-openssh-key":"  ErrorPipe: "" */
/* 2022-11-03 18:03:25 [nextcloudpi lokal] */ /* SSH output after 1200 ms. OutPipe: ""  ErrorPipe: "Wrong passphrase
Wrong passphrase
" */
/* 2022-11-03 18:03:47 [nextcloudpi lokal] */ /* Ping server ... */

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