I want to run a GUI application on a remote machine I only have ssh access to. I don't need to, or want to, see the GUI window. (I know I could use something like
ssh -C -X remote_server if I wanted the GUI to be on my client.)
I know X is running on the remote machine, as
ps shows this:
root ... /usr/bin/Xorg :0 -br -audit 0 -auth /var/gdm/:0.Xauth -nolisten tcp vt7
DISPLAY=:0.0 but I then get "Xlib: connection to ":0.0" refused by server" when I try to use it.
At Get remote x display working in linux without ssh tunneling and Xserver doesn't work unless DISPLAY=0.0 I see the advice to use gdmsetup to allow X to listen on TCP. But, gdmsetup is a GUI application! And trying to run it over ssh -X did not work ("X11 connection rejected because of wrong authentication").
So, is there a text file I can edit to remove
-nolisten? And, after editing it, how do I safely restart X, remotely? (There is other stuff running on this machine, so requesting a reboot is possible, but undesirable.) If not, should gdmsetup be able to run over ssh and I should persevere in that direction?
UPDATE: I had to do the
ssh -X session as root (ssh as a normal user, then sudo or su, does not work.) So, I did the edit with gdmsetup. I then restarted X with
gdm-restart. I've also done
xhost + from that ssh -X session. The ps line no longer shows the
-nolisten tcp part. But still no luck connecting to it, with either
UPDATE#2: I just noticed the reason
xauth + hadn't helped (when done over
ssh -X) was it altered my client machine, not the remote server! Oops. Good job I was inside the firewall! (I think the reason it had done this was related to the XAUTHORITY environmental variable, see Cougar's reply.)