I am very confused about the field X11DisplayOffset
in sshd_config
Offset mean a position shift from the correct as lubuntu - Display offset. See image - Ask Ubuntu
However, when do ssh -X user@host
to open 'firefox' on a remote desktop,
The Browser display correctly without offset.
What does X11DisplayOffset
do?
X11DisplayOffset
does not refer to an offset within the geometry of the display - it relates to the identification of which display clients started over the SSH connection should use in order not to interfere with local displays. Fromman sshd_config
:The architecture of X Windows allows for an X server to manage multiple displays. Typically on a standalone workstation with a single local user, you only have to deal with a single display - usually numbered 0 and often referred to as
:0
, for example in environment variable assignments likeDISPLAY=:0
. But on servers that may be running several X sessions (users remoting in via VNC for example, or separate X sessions on different virtual terminals) there may be multiple displays, labelled:1
,:2
, and so on.When X11 forwarding over SSH is added to the mix, that adds a requirement for additional unique display numbers (so that X clients tunneled over the SSH connection get directed to the correct remote display server). In order to avoid conflicts with local displays, an offset is added to the display numbering scheme so that the remote displays are numbered
:10
,:11
,:12
,...
The directive
X11DisplayOffset
is related to the$DISPLAY
environment variable. Fromman sshd_config
:So, with the default settings, when you are using the
-X
option in your ssh command to the$DISPLAY
envvar will be assigned value as follow (note without-X
or-Y
the variable will be unset):where:
localhost
(hostname
) is the name of the computer where the X server runs. An omitted hostname means the localhost.10
(D
) is a sequence number. It can be varied if there are multiple displays connected to one computer.0
(S
) is the screen number. A display can actually have multiple screens.