LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   can't run X11 programs from xterm (https://www.linuxquestions.org/questions/linux-general-1/cant-run-x11-programs-from-xterm-126938/)

Sin-D 12-18-2003 10:38 AM

can't run X11 programs from xterm
 
Heya,

I got a 'little' problem, often when i want to start a program through the terminal while being in X window system it can't open the GUI.

Then it gives the following error message:
Code:

Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

Or with another program:
Code:

linux:/home/me # guarddog
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

guarddog: cannot connect to X server :0.0

However when i try to run the program from the kde menu it works fine.

Any ideas? Thank you

Suse linux 9.0 pro.
pentium4 3 ghz
512 mb ram
Asus P4P800
Ati Radeon 9800Pro 128 mb
:scratch:

RolledOat 12-18-2003 11:19 AM

Hmmm, are you doing an su to another user. It is pretty simple, as root, or user, before the
su, enter
xhost + localhost

This will allow other users to connect to the running user's X session.

R.O.

Tinkster 12-18-2003 11:29 AM

Tsk tsk tsk ;)

RolledOat, that's only half the story!
You'dhave to add export DISPLAY=localhost:0.0
in the respective shell, too ...

And then, xhost + is always a security risk.
The cleaner alternative is a local ssh connection.

ssh -X <otheruser>@localhost <program>


Cheers,
Tink

RolledOat 12-18-2003 11:41 AM

Ahhh, tink, it was not saying 'unknown host/location'. It knew where to connect, just wasn't allowed to. Plus, adding localhost to xhost + is not that great a risk because only someone logged into localhost can connect to it. (If they had ssh/rsh, etc access, they would redirect to their local machine, which is a whole nother ball of wax).

I would agree that ssh is more secure, but did not want to overwhelm the poster. Besides, if the xhost + localhost
didn't work, with a new error, then I would get into export DISPLAY, etc.

R.O.

Sin-D 12-18-2003 11:55 AM

thanks guys, both worked great :)


All times are GMT -5. The time now is 10:28 PM.