LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   root not able to use display?? (https://www.linuxquestions.org/questions/linux-security-4/root-not-able-to-use-display-319315/)

browny_amiga 05-02-2005 08:30 AM

root not able to use display??
 
Blast, this is driving me nuts. I am hardly a newbie, but this really managed to annoy me.
I posted this under security, because I believe that it is security that is tripping me up.

My number 1 annoyance so far in linux:

I am normal user, execute xeyes. it works
I su - to root.
I execute xeyes and bang: can't open display.

Hey, root is GOD, he can do anything. Access denied? What the heck...

so far I have done this, with no success:
-set the DISPLAY variable to the same as it is for the user.
-xhost + to allow all users to use the X server.

Can somebody please explain to me why this is such a PITA? HOW do we expect a newbie to dutifully (as sysadmin always preach, no using root to log in) and execute a X program under root? This should not be such a pain.

annoyed*usually*penguin*adoring*user*that*has*just*ended*wrestling*another*hour*with*the*
X*permission*system*for*the*204120 time

Markus

win32sux 05-02-2005 08:42 AM

just curious: why do you want to run xeyes as root??

browny_amiga 05-02-2005 08:57 AM

Diagnosis.
xeyes is a example for a program that I need to run in root mode. Small and neat, it starts fast and if it works, the real program that I want to launch will also work. If it fails, the other one does also.

stickman 05-02-2005 04:43 PM

Before you su to root, use xhost command to allow access for localhost. Su to root, then set DISPLAY variable.

browny_amiga 05-26-2005 03:28 AM

SOLUTION!
 
Well, thanks for your contributions.

I figured out what the problem was:
you have to EXPORT the display variable, otherwise it does not work.

cheers

Markus

browny_amiga 06-17-2005 03:01 AM

even better... solution
 
And for all the ones that want a simple solution and don't know this already, here is what I just found:

gksu [command]

runs a command with root priviledges and also sets the permissions right, so no error messages when using X.

Great way to use for desktop application links that need root.


All times are GMT -5. The time now is 08:17 AM.