Cygwin program (sshpass) produces no output when used in Windows command prompt
The reason that this does not work is due to an incompatibility in stdin/stdout redirection between cygwin and native Win32 programs but there is a wrapper program called cygnative
which solves the problem. It allows the desired command-line to be used like this:
C:> cygnative sshpass -p password ssh -o StrictHostKeyChecking=no user@host ls
(this works for non-interactive commands but not for interactive terminal sessions)
The original author's links to cygnative.exe
are dead, but it is available as C source in this gist or as source and executable in this zip.
I discovered this solution when trying to solve another problem, this time trying to use rsync
over PuTTY's plink
program. I was getting an error:
Unable to read from standard input: The parameter is incorrect.
which led me to discover cygnative
, but tracking it down was difficult due to the original links being dead.
The problem is described here and presents the solution, cygnative
, here, with an updated version 1.2 here.