SSH command wrong on windows

justrusty's profile image justrusty posted 3 weeks ago in General Permalink

I get "Connection failed" always with ssh.exe in HeidiSQL, but can connect on CLI fine I notice in the ssh command it is passing -pw "password" but that throws an error on command line, and the actual flag is -P Is there a way we can use our own command for ssh tunneling?

justrusty's profile image justrusty posted 3 weeks ago Permalink

Works Ok if I delete the password and just use the key file

ansgar's profile image ansgar posted 3 weeks ago Permalink

On Windows ssh.exe, -P tag is not a port or password option; it is for selecting a resident key on supported security hardware under the Windows OpenSSH client.

AFAIK only plink supports an ssh password on the command line. HeidiSQL passes it with -pw to the tool, anyway if it's plink or ssh.

The solution is mostly either to use plink if you cannot work without password. The better one is to use a key instead of a password. This is again supported by plink and ssh.

Now on Linux, there is "sshpass" which HeidiSQL now uses when you provide a password. It's the only way to use a SSH password, and there is no plink on Linux.

justrusty's profile image justrusty posted 3 weeks ago Permalink

Ah I see, thanks! For some reason it didn't work with just the key initially, so I though I was forced to use password. But since it is working with just the key now, maybe just needed a restart. All good now, thanks a lot

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