Open doggy8088 opened 2 years ago
A possibly related question: how can one control in OpenSSH for Windows whether sshd
performs input and output with a command that it invokes either
ssh-shellhost.exe
/ConPTY to communicate with a console application via console I/O/ConsoleAPIThat distinction between binary-transparent low-level I/O and cursor-control-oriented console I/O in Windows does not exist under Unix, and therefore I assume there must be some selection mechanism to tell OpenSSH for Windows, which of these to use. I have a suspicion that distinction may be involved in why people have problems using OpenSSH for Windows as a transport tunnel with Unix applications such as rsync, git and subversion, which all pass compressed binary files via stdio to the other side, i.e. are definitely not using SSH as any kind of console application (with UTF-8, ANSI codes and line feeds). Because the ConPTY route will translate/rewrite all ANSI control sequences and is therefore hardly suited as a binary-transparent channel for compressed file transfer, which will only work via Unix-style pipes to redirected stdin/stdout via low-level _read()
and _write()
, right?
This is something that I never found well explained in the OpenSSH for Windows documentation, and as this distinction doesn't exist in Unix, the upstream OpenSSH documentation won't be able to help here either.
Met the exact same problem. Using cmd also doesn't help.
Does this rsync: connection unexpectedly closed
problem still occur with version v9.2.2.0p1 Beta?
https://github.com/PowerShell/Win32-OpenSSH/releases/tag/v9.2.2.0p1-Beta
Because that release fixed the long-standing bug #2012 that had caused a somewhat similar-looking early-EOF problem when OpenSSH for Windows is used with git fetch
.
It is still there with v9.2.2.0p1-Beta
rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]
rsync error: error in rsync protocol data stream (code 12) at io.c(231) [Receiver=3.2.7]
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(231) [sender=3.2.7]
Use msys2's ssh.exe to transfer normally. Win32-OpenSSH here keeps reporting errors.
rsync.exe -e E:/sdk/msys64/usr/bin/ssh.exe
Troubleshooting steps https://github.com/PowerShell/Win32-OpenSSH/wiki/Troubleshooting-Steps
Configure OpenSSH Server
Install cwRsync
Create
user1
user locally with password123
Try to copy file using
scp
Try to copy file using
rsync
This will fail.
I tried to troubleshoot this problem.
It shows:
I can't really understand what's the problem.
Change to use cwRsync's
ssh.exe
This will okay!
Try to show ssh logs:
The result:
Terminal issue? please go through wiki https://github.com/PowerShell/Win32-OpenSSH/wiki/TTY-PTY-support-in-Windows-OpenSSH
Please answer the following
"OpenSSH for Windows" version
((Get-Item (Get-Command sshd).Source).VersionInfo.FileVersion)
Server OperatingSystem
((Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion\" -Name ProductName).ProductName)
Client OperatingSystem
Same machine
What is failing
Show in Troubleshooting steps Step 5.
Expected output
Show in Troubleshooting steps Step 6.
I expected the Win32-OpenSSH's
ssh.exe
should able to use with any program.Actual output
Show in Troubleshooting steps Step 5.