Software >> Services >> SSH >> OpenSSH >> Why is the DISPLAY variable set to localhost:10.0 by default on your SSH session

 

 

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.

 

NOTE: This is the SSH Server side, the SSH Client side (where the X11 server is running), the display location may be different