Running GUI app as root (via SSH)
I ssh -X username@server to a Solaris 9 box as a normal user and su - to root and run /path/to/program and it says "Error: Can't open display:"
Does anyone know what I need to do to be able to run this program? Thanks. |
If you su to root I think that the variable DISPLAY will not be set, while it will be set in the environment of the user which connects via ssh (you can try an
Code:
echo $DISPLAY Code:
DISPLAY=youmachine:yourscreen Code:
DISPLAY=192.168.1.1:0 Enrico |
Thanks for your help. As normal user when I do echo $DISPLAY
I get localhost:14.0. I su - to root and do export DISPLAY=localhost:14.0 and when I run the GUI app it says - X11 connection rejected because of wrong authentication. X connection to localhost:14.0 broken (explicit kill or server shutdown). My local machine's echo DISPLAY is set to ":0.0" and tried to set the DISPLAY on the server as export DISPLAY=/my-local-machine's IP:0.0/ and run my GUI app again and it hangs in there - I don't see anything. Running the GUI app as a normal user still works fine. Any further help would be much appreciated. Thanks. |
The behaviour you observe is expected. The X server thinks root is trying to hijack your user's X session.
Try using "su" not "su -" to keep your environment. |
Thanks all for your help. I can now get the GUI.
|
All times are GMT -5. The time now is 11:22 AM. |