LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 11-30-2005, 07:44 PM   #1
slinky2004
Member
 
Registered: Oct 2004
Posts: 309

Rep: Reputation: 30
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?
 
Old 11-30-2005, 08:25 PM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,165

Rep: Reputation: 330Reputation: 330Reputation: 330Reputation: 330
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.
 
Old 11-30-2005, 08:29 PM   #3
slinky2004
Member
 
Registered: Oct 2004
Posts: 309

Original Poster
Rep: Reputation: 30
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.
 
Old 11-30-2005, 09:14 PM   #4
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,165

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 start some apps as root davcefai Debian 12 01-13-2013 11:38 PM
Restricting Editing in Sudo (Advanced Sudo Question) LinuxGeek Linux - Software 4 11-04-2006 04:20 PM
Where to Start: Writing C++ KDE Apps BuckRogers01 Programming 28 10-19-2005 04:52 PM
start apps automatically on start up? chunlee Linux - Newbie 3 09-04-2004 01:58 PM
howto start vpnclient with php script and sudo ? cccc Programming 1 01-12-2004 12:46 PM


All times are GMT -5. The time now is 05:29 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration