Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 05-15-2006, 01:05 AM   #1
Registered: Jul 2004
Distribution: Debian, Ubuntu, FreeBSD, RHEL
Posts: 202

Rep: Reputation: 31
sudo + x11

Hello guys,

Iam having issues giving users access in using x11 based programs (ie: ethereal) everytime they execute it.. it wont appear in gui.. gives a display error.

I have been trying to figure out how to do this: I tried 1 thing it was:

xauth merge ~<yourregularuser>/.Xauthority; export DISPLAY=:0.0
then i tried sudo program

still nothing

Any ideas?
Old 05-15-2006, 03:28 AM   #2
Registered: Aug 2003
Distribution: Debian, Ubuntu
Posts: 188

Rep: Reputation: 30
I assume, that you want start a graphical tool from the command line, and that you want to do this within a running X session, using a window manager like kde or gnome.

Can you please post the error message?

sudo is a tool to allow users running programs with other users rights. E.g., to allow a non privileged user to run the "passwd" program for root. Or something like this.

Perhaps the following is your problem:
If you want to run a graphical program as user b, but startet the X-session as user a, the X-server denies user b any access. For security.
The corresponding error message looks like:
Error: Can't open display: :0.0
User a can allow other users to use his X-Session with
xhost +
Old 05-15-2006, 04:22 AM   #3
Registered: Mar 2005
Location: Cascade Mountains WA USA
Distribution: Linux From Scratch (LFS)
Posts: 149

Rep: Reputation: 16
CAUTION!!!! using the command 'xhost +' or 'xhost +all' will open X up to programs started from ANY host

This is a MAJOR security opening, and not advised (especially if you are ROOT..don't run as root...bad bad bad bad *rolls up newspaper*, don't make me use this!)

it's a much better idea to do this:
 xhost +localhost
 xhost +
both commands are really the same thing
xhost -all
will close the hole again
Old 05-15-2006, 08:43 AM   #4
Registered: Aug 2003
Distribution: Debian, Ubuntu
Posts: 188

Rep: Reputation: 30
Yes, big Ack.

Just wanted to mention the mechanism, thought that next step would be man and all deriving implications.
Sorry, pledging amendment.

Err. Just to proof my will to do better: It is generally a good idea, not to start a window manager as root.

Last edited by Clemente; 05-15-2006 at 08:45 AM.


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
Restricting Editing in Sudo (Advanced Sudo Question) LinuxGeek Linux - Software 4 11-04-2006 03:20 PM
Sudo and ssh X11 fowarding Mike_the_Man Linux - General 1 05-03-2006 11:04 PM
Core 4 - X11-devel complains about X11-libs which are installed Ephracis Fedora 3 09-05-2005 09:32 AM
Sudo and X11 programs 65_289 Linux - Software 1 05-17-2005 08:42 PM
Roaming X11/Xfree86, X11 proxy zapp Linux - Software 1 09-12-2003 08:06 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:31 AM.

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