Open tylerszabo opened 3 years ago
This seems to be related to #1182 and possibly related to #1675. It may also be related to #1593, #1563, and #1181.
same in 8.6.0.0
CTRL+\ seems to work OK in some cases - which may be a help to people until this is resolved...
Same issue. And sometimes I notice that the issue will happen in:
Somehow I guess this is due to something outside of OpenSSH, related to windows.
((Get-Item (Get-Command ssh).Source).VersionInfo.FileVersion) 8.1.0.1
Windows version is: 19044.1415
I can reproduce this with the xauth.exe
from the vcxsrv
Chocolatey package.
When I place the following in my ~/.ssh/config
:
XAuthLocation "/Program Files/VcXsrv/xauth.exe"
pressing CTRL-C
in an ssh session with X11 forwarding enabled as follows:
Host myserver
ForwardX11 yes
ForwardX11Trusted yes
terminates the session.
(gi /Windows/System32/OpenSSH/ssh.exe).versioninfo.fileversion
# 8.6.0.1
Windows 11 build 22543 X64
Something similar happens when port forwarding with -L
is performed, and -N
is given to not request a terminal on the far end. (Using 8.1.0.1 under Windows 10 Enterprise.)
ssh -i private-key-file.pem -L 12345:remote.host.address:67890 -N user@bastion.host.address
^C
should end the ssh.exe process and close the tunnel, but nothing happens. Same for Ctrl+\ from the comments above, no luck.Only way I've found of ending the ssh process is to open task manager, find the ssh.exe
task (under the PowerShell task if the task manager is set to group them), and killing it -- at which point the PowerShell window prints out all of the ^C and ^\ keystrokes that were entered.
Troubleshooting steps https://github.com/PowerShell/Win32-OpenSSH/wiki/Troubleshooting-Steps
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)
8.1.0.1
Server OperatingSystem
((Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion\" -Name ProductName).ProductName)
Debian 10.9 (4.19.0-16-amd64)
Client OperatingSystem
Windows 10 Pro (10.0.19043.985)
What is failing
Using
CTRL+C
in an SSH session with X11 forwarding andXAuthLocation
set to a program will cause ssh to crash with exit status-1
.Using VcXsrv here's a matrix of the outcomes where "Fail" indicates ssh exiting with status -1 and "Pass" indicates CTRL+C was passed through the connection (in my case to my shell on the server).
Note that these examples are to show which states cause
CTRL+C
to kill ssh, not all cases will succeed in forwarding X11.For access control enabled tests VcXsrv was run with
vcxsrv :0 -multiwindow -clipboard -wgl -swrastwgl -auth %USERPROFILE%\.Xauthority
and%USERPROFILE%\.Xauthority
was configured withxauth generate .
such thatxauth list
shows an entry. For access control disabled tests VcXsrv was run withvcxsrv.exe :0 -multiwindow -clipboard -wgl -swrastwgl -ac
.C:\Progra~1\VcXsrv\xauth.exe
-Y
C:\Progra~1\VcXsrv\xauth.exe
-X
C:\Progra~2\GnuWin32\bin\true.exe
-Y
C:\Progra~2\GnuWin32\bin\true.exe
-X
C:\Progra~2\GnuWin32\bin\false.exe
-Y
C:\Progra~2\GnuWin32\bin\false.exe
-X
C:\Windows\System32\calc.exe
-Y
C:\Windows\System32\calc.exe
-X
NUL
-Y
NUL
-X
C:\Progra~1\VcXsrv\xauth.exe
-Y
C:\Progra~1\VcXsrv\xauth.exe
-X
C:\Progra~2\GnuWin32\bin\true.exe
-Y
C:\Progra~2\GnuWin32\bin\true.exe
-X
C:\Progra~2\GnuWin32\bin\false.exe
-Y
C:\Progra~2\GnuWin32\bin\false.exe
-X
C:\Windows\System32\calc.exe
-Y
C:\Windows\System32\calc.exe
-X
NUL
-Y
NUL
-X
If there is no X11 Forwarding the setting of
XAuthLocation
is irrelevant andCTRL+C
is correctly passed.Expected output
No exit failure when
CTRL+C
is passed to the program running in the SSH session, even when X11 access control is enabled and configured.C:\Progra~1\VcXsrv\xauth.exe
-Y
C:\Progra~1\VcXsrv\xauth.exe
-X
C:\Progra~1\VcXsrv\xauth.exe
-Y
C:\Progra~1\VcXsrv\xauth.exe
-X
C:\Progra~2\GnuWin32\bin\false.exe
-Y
Actual output
Exit with status
-1