[Bug report] Can't connect using Plink with new version

[expired user #8632]'s profile image [expired user #8632] posted 9 years ago in General Permalink
Hello Guys,

I was using r4545 and after updating to newer version I can't connect through SSH tunnel anymore. I tried the last version r4896, r4816 and r4781 without success. As soon as I rolled back to r4545 it started working again. I couldn't try more because I couldn't find the links to older builds.

Here is the error I get immediately (no delay, so it's even trying to connect) after clicking "Open" in the "Session manager". If I run it in the command line manually it does run perfectly.

I have tried 32 and 64 bit.

System info: Windows 8.1 64bit

The error I get is:
PLink exited unexpected. Command line was: C:\***plink.exe -ssh ***@*** -w "***" -P 22 -i "C:\****.ppk" -N -L 3327:***:3306

jfalch's profile image jfalch posted 9 years ago Permalink
what happens when you copy that command line to a command window (cmd.exe) and execute it ? any error messages from plink ?
[expired user #8632]'s profile image [expired user #8632] posted 9 years ago Permalink
@jfalch, thanks for your reply. As mentioned in my first post, when I run it at a command window it executes properly. No errors.
ansgar's profile image ansgar posted 9 years ago Permalink
Please play with the parameters, e.g. by leaving away that private key file name.
[expired user #8632]'s profile image [expired user #8632] posted 9 years ago Permalink
Hello ansgar,

1.
Taking out the private key file shows this inmediately (no delay, so it's not trying to connect):


2.
Taking out the password shows this message after half second:

and then after a few seconds:

If I remove the password and private key file name, the same as above happens.

In the old version I used to have a private key file that was password protected and in the Password field I would enter the private key password. I have tried now with a private key without any password protection and the secure shell password empty as well. No success.

I want to emphasize once again that it was working perfectly on r4545 and it stopped working after updating.
[expired user #8632]'s profile image [expired user #8632] posted 9 years ago Permalink
It might be a little silly. But I think the application is not passing the -ssh flag to plink. The reason why I say this is because of the message "SSH-2.0-OpenSSH_4.3" if I type the command from the error

without the -ssh and without -pw I get the same text that is displayed in the popup.

and like in the program, if I type a password it exits unexpectedly:
[expired user #8632]'s profile image [expired user #8632] posted 9 years ago Permalink
I've got very interesting findings. I created a program in C# that writes to a file whatever it is passed as arguments, separating each one with a new line.

Running r4896:
WriteLines1:
username123@sshhost
-pw
password123
-P
22
-i
C:\gfhf private_key.ppk
-N
-L
3321:finalhostname:3306


WriteLines2:
-ssh
username123@sshhost
-pw
password123
-P
22
-i
C:\gfhf private_key.ppk
-N
-L
3321:finalhostname:3306


Running r4545:
WriteLines1:
-ssh
username123@sshhost
-pw
password123
-P
22
-i
C:\gfhf private_key.ppk
-N
-L
3321:finalhostname:3306


WriteLines2:
C:\Users\Ivan\ArgumentsLogger.exe
-ssh
username123@sshhost
-pw
password123
-P
22
-i
C:\gfhf private_key.ppk
-N
-L
3321:finalhostname:3306


Running from command line:
(C:\Users\Ivan\ArgumentsLogger.exe -ssh username123@sshhost -pw pas
sword123 -P 22 -i "C:\gfhf private_key.ppk" -N -L 3328:finalhostname:3306)
WriteLines1:
-ssh
username123@sshhost
-pw
password123
-P
22
-i
C:\gfhf private_key.ppk
-N
-L
3328:finalhostname:3306


WriteLines2:
C:\Users\Ivan\ArgumentsLogger.exe
-ssh
username123@sshhost
-pw
password123
-P
22
-i
C:\gfhf private_key.ppk
-N
-L
3328:finalhostname:3306


Do you notice how with the new version it changes compared to the old version and using the command prompt?

This is the code of the C# program:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ArgumentsLogger
{
class Program
{
static void Main(string[] args)
{
String[] arguments = Environment.GetCommandLineArgs();
System.IO.File.WriteAllLines(@"C:\Users\Ivan\WriteLines1.txt", args);
System.IO.File.WriteAllLines(@"C:\Users\Ivan\WriteLines2.txt", arguments);
}
}
}
[expired user #8632]'s profile image [expired user #8632] posted 9 years ago Permalink
Aad workaround found after reading the code of dbconnection.pas

I just placed -ssh before the Username field in the "SSH tunnel" tab. Example: "--sh username123" without quotes.
[expired user #8632]'s profile image [expired user #8632] posted 9 years ago Permalink
Correction:
And workaround found after reading the code of dbconnection.pas

I just placed -ssh before the Username field in the "SSH tunnel" tab. Example: "-ssh username123" without quotes.
ansgar's profile image ansgar posted 9 years ago Permalink
Hmm.. As you can see in your initial post, there is already a "-ssh" parameter prefix in the command line, isn't there?

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