LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   cant start X apps using su or sudo (https://www.linuxquestions.org/questions/linux-newbie-8/cant-start-x-apps-using-su-or-sudo-388073/)

slinky2004 11-30-2005 06:44 PM

cant start X apps using su or sudo
 
in the past, i've always been able to use su to start an X application, for example, say i'm loogged on as slinky and i do an "su root" and then "firefox", it would start up firefox as root. Now when i do that, it gives an error:
Quote:

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


(firefox-bin:4905): Gtk-WARNING **: cannot open display:
i can start firefox fine, if i log into X as root. why does this happen? how can i change it back?

btmiller 11-30-2005 07:25 PM

For security reasons, your X server only allows connections from the user that started it. If you do "xhost +localhost", that will allow connections from all users on the local system. See "man xhost" for more details.

slinky2004 11-30-2005 07:29 PM

it didnt work. i did xhost +localhost and it said "localhost being added to access control list", but then i tried to su and start firefox and it gave me that error.

btmiller 11-30-2005 08:14 PM

Try xhost +<your host name> -- if that doesn't work, make sure that the $DISPLAY environment vaqriable is set in your su shell.


All times are GMT -5. The time now is 07:48 PM.