LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 05-02-2005, 08:30 AM   #1
browny_amiga
Member
 
Registered: Dec 2001
Location: /mnt/UNV/Mlkway/Earth/USA/California/Silicon Valley
Distribution: Kubuntu, Debian Buster Stable, Windoze 7
Posts: 684

Rep: Reputation: 56
Angry 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
 
Old 05-02-2005, 08:42 AM   #2
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
just curious: why do you want to run xeyes as root??
 
Old 05-02-2005, 08:57 AM   #3
browny_amiga
Member
 
Registered: Dec 2001
Location: /mnt/UNV/Mlkway/Earth/USA/California/Silicon Valley
Distribution: Kubuntu, Debian Buster Stable, Windoze 7
Posts: 684

Original Poster
Rep: Reputation: 56
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.
 
Old 05-02-2005, 04:43 PM   #4
stickman
Senior Member
 
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
Before you su to root, use xhost command to allow access for localhost. Su to root, then set DISPLAY variable.
 
Old 05-26-2005, 03:28 AM   #5
browny_amiga
Member
 
Registered: Dec 2001
Location: /mnt/UNV/Mlkway/Earth/USA/California/Silicon Valley
Distribution: Kubuntu, Debian Buster Stable, Windoze 7
Posts: 684

Original Poster
Rep: Reputation: 56
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
 
Old 06-17-2005, 03:01 AM   #6
browny_amiga
Member
 
Registered: Dec 2001
Location: /mnt/UNV/Mlkway/Earth/USA/California/Silicon Valley
Distribution: Kubuntu, Debian Buster Stable, Windoze 7
Posts: 684

Original Poster
Rep: Reputation: 56
Lightbulb 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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cannot open display as root tethysgods Linux - Software 14 12-10-2010 03:16 PM
root cant use display???? haora Linux - Newbie 3 07-05-2005 07:45 AM
only root can open the display for mplayer shobhit Linux - Software 5 06-16-2005 03:34 PM
Can't open display as root dicou Linux - Newbie 7 04-18-2005 02:25 PM
root cannot open display m_yates Linux - Software 7 03-14-2004 10:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 09:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration