PowerShell / PowerShell/Win32-OpenSSH

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

Open
#1,803 6 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
8.3k
Forks
819
PR merge metrics
No merged PRs in 30d

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked troubleshooting steps and reproduce the issue using a Windows client, X11 forwarding, and XAuthLocation set to a program, comparing the provided matrix. Done means CTRL+C reaches the remote session without ssh exiting with status -1, including when X11 access control is enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
networking, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.