Skip to content

Using CTRL+C in an SSH session with X11 forwarding and XAuthLocation set will cause ssh to terminate with error #1803

Description

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 and XAuthLocation 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 with xauth generate . such that xauth list shows an entry. For access control disabled tests VcXsrv was run with vcxsrv.exe :0 -multiwindow -clipboard -wgl -swrastwgl -ac.

XAuthLocation Forwarding Mode Access Control X11 Forwarded CTRL-C Passed
C:\Progra~1\VcXsrv\xauth.exe -Y ✔ Enabled ✔ Yes ❌ No
C:\Progra~1\VcXsrv\xauth.exe -X ✔ Enabled ✔ Yes ❌ No
C:\Progra~2\GnuWin32\bin\true.exe -Y ✔ Enabled ❌ No ❌ No
C:\Progra~2\GnuWin32\bin\true.exe -X ✔ Enabled ❌ No ❌ No
C:\Progra~2\GnuWin32\bin\false.exe -Y ✔ Enabled ❌ No ❌ No
C:\Progra~2\GnuWin32\bin\false.exe -X ✔ Enabled ❌ No ❌ No
C:\Windows\System32\calc.exe -Y ✔ Enabled ❌ No ❌ No
C:\Windows\System32\calc.exe -X ✔ Enabled ❌ No ❌ No
NUL -Y ✔ Enabled ❌ No ✔ Yes
NUL -X ✔ Enabled ❌ No ✔ Yes
C:\Progra~1\VcXsrv\xauth.exe -Y ⚠ Disabled ✔ Yes ❌ No
C:\Progra~1\VcXsrv\xauth.exe -X ⚠ Disabled ✔ Yes ❌ No
C:\Progra~2\GnuWin32\bin\true.exe -Y ⚠ Disabled ✔ Yes ❌ No
C:\Progra~2\GnuWin32\bin\true.exe -X ⚠ Disabled ❌ No ❌ No
C:\Progra~2\GnuWin32\bin\false.exe -Y ⚠ Disabled ✔ Yes ❌ No
C:\Progra~2\GnuWin32\bin\false.exe -X ⚠ Disabled ❌ No ❌ No
C:\Windows\System32\calc.exe -Y ⚠ Disabled ✔ Yes ❌ No
C:\Windows\System32\calc.exe -X ⚠ Disabled ❌ No ❌ No
NUL -Y ⚠ Disabled ✔ Yes ✔ Yes
NUL -X ⚠ Disabled ❌ No ✔ Yes

If there is no X11 Forwarding the setting of XAuthLocation is irrelevant and CTRL+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.

XAuthLocation Forwarding Mode Access Control X11 Forwarded CTRL-C Passed
C:\Progra~1\VcXsrv\xauth.exe -Y ✔ Enabled ✔ Yes ✔ Yes
C:\Progra~1\VcXsrv\xauth.exe -X ✔ Enabled ✔ Yes ✔ Yes
C:\Progra~1\VcXsrv\xauth.exe -Y ⚠ Disabled ✔ Yes ✔ Yes
C:\Progra~1\VcXsrv\xauth.exe -X ⚠ Disabled ✔ Yes ✔ Yes
C:\Progra~2\GnuWin32\bin\false.exe -Y ⚠ Disabled ✔ Yes ✔ Yes

Actual output

Exit with status -1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions