Does ssh.exe currently work?

giraffedata's profile image giraffedata posted 2 years ago in Creating a connection Permalink

Does an SSH tunnel with ssh.exe currently work? For me, it executes a command with a "-pw" option for the password, but ssh.exe doesn't have such an option, so it fails.

As far as I know, my ssh.exe came with Windows 10.

Also, if ssh.exe asks for user input, does this make the tunnel fail silently? Because I surmise that when I leave the password field blank, HeidiSQL is invoking ssh.exe in a way that causes it to prompt for information (password and unknown host confirmation) and HeidiSQL is just proceeding as if the tunnel got set up and then I get an error because the HeidiSQL cannot cannot connect to the local end of the tunnel.

I can get the tunnel going with ssh.exe in a Windows command window, by the way; my issues are just with getting HeidiSQL to do it for me.

ansgar's profile image ansgar posted 2 years ago Permalink

Yes, ssh.exe does not support passing a password, so you have to either use a blank password, or use a private key file instead. I would recommend to use a private key. If you need to use a password with a tunnel created by Heidi, you will have to keep using plink.

giraffedata's profile image giraffedata posted 2 years ago Permalink

Thanks; and the second question? Would the tunnel fail silently if the tunnel program (e.g. ssh.exe) prompted for user input?

I'm just trying to make sense of the symptoms.

ansgar's profile image ansgar posted 2 years ago Permalink

plink has various prompts which HeidiSQL manages to show as a dialog. For example the prompt to store a new key in the local cache.

My code for the tunnel should display any stdout text from the ssh process as a message dialog. If the message matches some known expressions from plink, the dialog is an input prompt, e.g.

  • login as\s*\: will ask you for the username
  • (password|Passphrase for key "[^"]+")\s*\: asks for the password, as in the screen below

Description

giraffedata's profile image giraffedata posted 2 years ago Permalink

OK, thanks. That's helpful.

I guess that's something else that works better for plink than for ssh.

I don't know much about Windows, but it apparently has the same Standard Output/Standard Error thing as Unix and the prompts from ssh.exe go to Standard Error and disappear and SSH's request for input kills the process. Just based on some experiments. I do see the informational messages from ssh.exe that HeidiSQL displays.

With enough experimentation and your help, I did get ssh.exe to work with public key authentication, but it would appear that ssh.exe function is in general at the experimental stage.

As a first time user of HeidiSQL, I chose ssh.exe because it seemed more standard, packaged with the OS and everything. I had never heard of plink, though I see now it's part of Putty, which I have installed, and HeidiSQL probably would have worked out of the box if I had just made the right choice at "SSH executable".

(The default SSH executable, by the way, is much worse than either ssh.exe or plink.exe: a null string. This is after choosing "PostgreSQL (SSH tunnel)").

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