I have built sshpass on Cygwin. It works perfectly from within a Cygwin terminal window:
sshpass -p password ssh -o StrictHostKeyChecking=no user@host
However, the exact same command from a Windows command prompt produces no output.
I tried a non-interactive command to see if that worked but it didn't:
sshpass -p password ssh -o StrictHostKeyChecking=no user@host ls
Both work fine from the Cygwin environment but not from a Windows command prompt. They do work from the Windows command prompt but there is no output. I know this because I can issue commands from a cmd.exe window and see the effects on the remote host. Also, plain ssh (the Cygwin one) works fine from the Windows command prompt.
How can I get output from sshpass when used in a Windows command prompt ?
Have you tried this?
– Andrew Apr 01 '17 at 04:51c:\cygwin\usr\binandc:\cygwin\usr\local\binin your%PATH%. Mine works, but exhibits the behaviour described in this question. I useStrictHostKeyCheckingto avoid the prompt offering to accept an unknown key, which you won't see if usingsshpass- it'll just fail silently. I suggest you build a plain-oldsshcommand-line and ensure that works cleanly before prepending that command-line withsshpass -p password. I've checked mine from both within a Cygwin terminal (which works fine) and from a Windows command prompt (which exhibits the problem I described). – starfry Apr 01 '17 at 14:17