Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

X11 forwarding should use network instead of unix socket and support being forwarded multiple times #14198

Closed
Assignees
mafredri
@mafredri

Description

@mafredri

Our current X11 forwarding implementation (inagentssh) uses Unix socket forwarding and places the socket file in/tmp/.X11-unix/X0.

New SSH connections overwrite the socket and take over communication. This means that connecting withssh -X twice, then disconnecting from the newest session will also disconnect the old session.

OpenSSH typically does X11 forwarding over port6000 and up, and generally starting from an offset of10 (i.e.6010). For OpenSSH theDISPLAY env looks commonly like:DISPLAY=localhost:10.0 (referring to port6010), whereasagentssh always sets this toDISPLAY=:0.0 (referring to/tmp/.X11-unix/X0).

Theagentssh behavior is problematic in a few situations:

  1. The agent doesn't have permission to write to/tmp/.X11-unix
  2. There's an X server running inside the workspace (will have allocated/tmp/.X11-unix/X0 already)
  3. The user wants the X11 connection to remain open even if other SSH sessions are closed

I propose we implement the listening port + start offset to avoid the conflict listed in 2.

An alternative method is to try/tmp/.X11-unix/X[0-9]+ until we find the next free slot and set theDISPLAY environment variable accordingly. (And if we use an offset it's unlikely to collide with X running in the workspace.)

Please note thatssh.X11.ScreenNumber inx11Callback shouldnot decide the number we use in the workspace, it should be the next free port or file.

Metadata

Metadata

Assignees

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


    [8]ページ先頭

    ©2009-2025 Movatter.jp