Problem with xhost
I was attempting to run a command spadmin which is used to set up printers and fonts in OpenOffice. When I run it a super user, it returns the error: XLib: connection to ":0.0" refused by server XLib: No protocol specified /opt/OpenOffice.org/program/spadmin.bin x11 error: Can't open display: :0 Set DISPLAY environment variable, use -display option Or check permissions of your X-Server (See "man X" resp. "man xhost" for details) I read the man pages, and toyed with the -display :0 option on spadmin, but got the same error. I then tried running "xhost +local" and "xhost +" (no network connection, no dialup access) and received the same two XLib error lines listed above. So, it looks like I've got a problem with my X Server configuration, but I can't seem to find anything about how to fix it. Also, I didn't glean from the man pages how to check the permissions of the X-Server as suggested in the error message. Any thoughts on how to fix this? Thanks. ---------------------------------------------------------------------------- ------------------------------- Bill Lugg Software Engineer, MilStar AF Command Post Terminal Software Support OO-ALC/MASFE, Peterson AFB, CO William.Lugg@cisf.af.mil <mailto:william.lugg@cisf.af.mil> The only difference between a tax man and a taxidermist is that the taxidermist leaves the skin. -- Mark Twain
I was attempting to run a command spadmin which is used to set up printers and fonts in OpenOffice. When I run it a super user, it returns the error:
XLib: connection to ":0.0" refused by server XLib: No protocol specified
/opt/OpenOffice.org/program/spadmin.bin x11 error: Can't open display: :0 Set DISPLAY environment variable, use -display option Or check permissions of your X-Server (See "man X" resp. "man xhost" for details)
I read the man pages, and toyed with the -display :0 option on spadmin, but got the same error. I then tried running "xhost +local" and "xhost +" (no network connection, no dialup access) and received the same two XLib error lines listed above. So, it looks like I've got a problem with my X Server configuration, but I can't seem to find anything about how to fix it. Also, I didn't glean from the man pages how to check the permissions of the X-Server as suggested in the error message. Any thoughts on how to fix this?
Hi Mr. Lugg, 1) as a regular user (who will su or sudo later) run: 'xhost +local:local' 2) now 'su' or 'sudo $foo' 3) The program run as super user will then work on the local X display 4) You may place 'xhost +local:local' in your favorite xinit script as well. Please note that using xhost is horribly insecure esp. if you are using a mutli-user system with more than one remote user as any remote user may now access YOUR display inc. recording your keystrokes if they are knowledgeable. HTH Sam Stern Baltimore, MD, USA
On Wed, 25 Feb 2004, Lugg William H Civ OO-ALC /MASFE wrote:
I was attempting to run a command spadmin which is used to set up printers and fonts in OpenOffice. When I run it a super user, it returns the error:
XLib: connection to ":0.0" refused by server XLib: No protocol specified
/opt/OpenOffice.org/program/spadmin.bin x11 error: Can't open display: :0 Set DISPLAY environment variable, use -display option Or check permissions of your X-Server (See "man X" resp. "man xhost" for details)
I read the man pages, and toyed with the -display :0 option on spadmin, but got the same error. I then tried running "xhost +local" and "xhost +" (no network connection, no dialup access) and received the same two XLib error lines listed above. So, it looks like I've got a problem with my X Server configuration, but I can't seem to find anything about how to fix it. Also, I didn't glean from the man pages how to check the permissions of the X-Server as suggested in the error message. Any thoughts on how to fix this?
instead of 'su', you should use 'sux' while in x. this sets up the environment properly and uses xauth instead of xhost, which is rather insecure. -- trey
participants (3)
-
Lugg William H Civ OO-ALC /MASFE
-
Sam Stern
-
Trey Gruel