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