UnixAdminsDiary

Thursday, May 13, 2004

Debian: can not open a X window from a remote machine on my display

Well, this is not only a Debian problem - it can appear on ever Linux (and also on Unix) platform, and it is a feature, not a bug ;-)
But I mention this with Debian, because Debian is the only system I know which has this security feature by default.
The situation is the following: you are sitting in front of your Debian box, running the local Xsession, managed by xdm/gdm/kdm (lets assume that we use kdm, but the others behave identically). You want to login to another Unix machine and want to run remote a X application (eg a xterm).
No problem, you just type on the debian box
xhost + and eg
telnet remote_machine (yes I know that it is better to use ssh instead of telnet ;-)

and after the login you type (on the remote machine)
export DISPLAY=debian_box:0.0
xterm

and - surprise, surprise - this fails ( ... can't open display .. and so on)

The solution is very easy:
all remote X access is controlled by xdm/gdm/kdm, and Debian configs them in a way that every remote X connection is denied. Eg in /etc/kde2/kdm/Xservers you will find a line looking like this:
:0 local@tty1 /usr/X11R6/bin/X -dpi 100 -nolisten tcp vt7
The -nolisten tcp denies the remote connection, so just remove it:
:0 local@tty1 /usr/X11R6/bin/X -dpi 100 vt7

After restaring the display manager, the remote X connects will work fine.



0 Comments:

Post a Comment

<< Home