Software >> Services >> SSH >> Server >> What configuration setting in sshd_config determines whether X11 forwarding is enabled and what is the display location number

e.g for Sun SSH

/etc/ssh/sshd_config

X11Forwarding yes

X11DisplayOffset 10

X11UseLocalhost yes
 

 

Note that for OpenSSH, the default display offset is 10, so we don't have to set X11DisplayOffset if we want to use offset of 10.  Similarly X11UseLocalhost, default is already yes.

As per man sshd_config:

  X11DisplayOffset
             Specifies the first display number available for sshd(8)'s X11 forwarding.  This prevents sshd from interfering with real X11 servers.  The
             default is 10.
 

     X11UseLocalhost
             Specifies whether sshd(8) should bind the X11 forwarding server to the loopback address or to the wildcard address.  By default, sshd binds the
             forwarding server to the loopback address and sets the hostname part of the DISPLAY environment variable to localhost.  This prevents remote hosts
             from connecting to the proxy display.  However, some older X11 clients may not function with this configuration.  X11UseLocalhost may be set to no
             to specify that the forwarding server should be bound to the wildcard address.  The argument must be yes or no.  The default is yes.