[Bug 2965] New: OpenSSH for Windows hangs if there is no STDIN

bugzilla-daemon at bugzilla.mindrot.org bugzilla-daemon at bugzilla.mindrot.org
Wed Feb 6 09:12:26 AEDT 2019


https://bugzilla.mindrot.org/show_bug.cgi?id=2965

            Bug ID: 2965
           Summary: OpenSSH for Windows hangs if there is no STDIN
           Product: Portable OpenSSH
           Version: 7.9p1
          Hardware: Other
                OS: Windows 10
            Status: NEW
          Severity: enhancement
          Priority: P5
         Component: ssh
          Assignee: unassigned-bugs at mindrot.org
          Reporter: leese at google.com

The simplest repro is to run the following in a cmd shell:

> ssh user at host -- echo x < NUL:
x
GetConsoleMode on STD_INPUT_HANDLE failed with 6


... and then it hangs and is unresponsive to input. If instead you pipe
in an empty file it works fine.

This becomes a pain when you are writing a script that shells out to
ssh to run a single remote command, as you need to provide a stdin file
or it will hang. So for example, in python on Windows:

subprocess.check_output(['ssh', 'user at host', '--', 'echo', 'x'])

will hang.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.


More information about the openssh-bugs mailing list