LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   root cannot connect to an X server in a terminal (https://www.linuxquestions.org/questions/linux-software-2/root-cannot-connect-to-an-x-server-in-a-terminal-143738/)

GameboyHippo 02-08-2004 01:42 PM

root cannot connect to an X server in a terminal
 
Hi,

When I su to root in a konsole window and try to run an X app such as xeyes, xclock, kpackage, etc... I get the following error:

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

Error: Can't open display: :0.0

Yet if I'm the user logged in, it will simply run as expected. How do I allow other users that I su into to run programs on the xserver? Is there a way to "permenantly" configure my PC to do that? (i.e. is there a startup script or whatever).

Thanks,

JT

smith847be 02-08-2004 02:15 PM

This means that root is not on the list of allowed users for X. I believe that you can just do this command:

xhost +local:root

to allow the root user to 'connect' to the X windows system.

r_jensen11 02-08-2004 04:07 PM

It's because you're not using the root user's paths. If you log in as root from a login screen, then you shouldn't have any problems.

GameboyHippo 02-09-2004 12:50 AM

Well the both replies seem to be correct. I already knew the second one, but I don't always like being logged in as root. Anyway, now that I added root to the xhost thingamabob, will it be permenant or will I have to do that everytime my computer happens to reboot?

smith847be 02-09-2004 10:25 AM

I think it's permanent. However, if it isn't, then you can just pick a random startup script in /etc/rc[whatever].d, and put that line in there.


All times are GMT -5. The time now is 07:21 AM.