LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices



Reply
 
Search this Thread
Old 05-20-2009, 09:55 PM   #1
lilsim89
LQ Newbie
 
Registered: May 2009
Posts: 3

Rep: Reputation: 0
--display parameter never works


I've been trying to execute a program from the command-line using sudo like so:

sudo -u user_progs /usr/bin/firefox --display=:0.0

But I always get an error like "Display not found."

BTW- This is on a local machine.


What am I missing? Maybe something to do with Xauth or .Xauthority?
 
Old 05-20-2009, 10:44 PM   #2
rnturn
Member
 
Registered: Jan 2003
Location: Illinois (Chicago area)
Distribution: Red Hat (8.0), SuSE (10.x, 11.x, 12.2, 13.2), Solaris (8-10), Tru64
Posts: 982

Rep: Reputation: 53
Try changing
Code:
sudo -u user_progs /usr/bin/firefox --display=:0.0
to
Code:
sudo -u user_progs /usr/bin/firefox --display :0.0
This ought to do the trick for you.

--
Rick
 
Old 05-21-2009, 02:02 AM   #3
lilsim89
LQ Newbie
 
Registered: May 2009
Posts: 3

Original Poster
Rep: Reputation: 0
Found the trick!

Thanks for the reply, rnturn, but that didn't seem to make a difference. It seems you need to run the command:

Code:
xauth local:
so that another use can have x display privileges, as it seems. Too bad I came accross an unrelated error that makes this method useless for me.

Case closed,

Simon
 
Old 05-21-2009, 09:57 AM   #4
rnturn
Member
 
Registered: Jan 2003
Location: Illinois (Chicago area)
Distribution: Red Hat (8.0), SuSE (10.x, 11.x, 12.2, 13.2), Solaris (8-10), Tru64
Posts: 982

Rep: Reputation: 53
Quote:
Originally Posted by lilsim89 View Post
It seems you need to run the command:

Code:
xauth local:
Interesting. I've never explicitly run that command. Now I have gone into the configuration editor and configured X to listen on port 6000 (so that I can open windows from other systems). When I tried my modified version of your "sudo" command it worked. Even though "xhost" told me that only "authorized clients can connect". Perhaps OpenSUSE issues that "xauth" command somewhere during X startup.

Sorry to hear that you ran into another roadblock. Try posting your problem here on LQ. There's lot of eyes looking at posts and someone ought to be able to help out.

Later... And "Have a lot of fun..."

--
Rick
 
Old 05-21-2009, 11:47 AM   #5
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,049

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
Xauth give other users authority to reach your X serssion.. By default no one else can use it but its propietary.
 
Old 05-21-2009, 02:17 PM   #6
rnturn
Member
 
Registered: Jan 2003
Location: Illinois (Chicago area)
Distribution: Red Hat (8.0), SuSE (10.x, 11.x, 12.2, 13.2), Solaris (8-10), Tru64
Posts: 982

Rep: Reputation: 53
Quote:
Originally Posted by i92guboj View Post
Xauth give other users authority to reach your X serssion.. By default no one else can use it but its propietary.
The root user seems to be able to access my X display regardless of the permissions (or lack thereof) that "xhost" is showing. Non-root users cannot use my display unless I let them. Even if I supposedly disable access using "host -", I can use the sudo command proposed by the original poster from another system and get access to my display. Seems as though locking down your display can be a bit tricky. (Good thing the firewall is not allowing port 6000 access.)
 
Old 05-26-2009, 05:53 PM   #7
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,546

Rep: Reputation: 51
Code:
chvt 7 ; sleep 5 ; XAUTHORITY=/var/lib/gdm/:0.Xauth DISPLAY=:0.0  xmessage  "$1"
 
  


Reply

Tags
display, xauth, xauthority


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
Moniter display doesn't works on 1024x768 Mustafa^Qasim Linux - Hardware 2 05-08-2007 12:19 PM
linux bash - how to use a dynamic parameter in shell parameter expansion expression nickleus Linux - General 2 08-21-2006 05:54 AM
Export DISPLAY works from linux boxes but not from unix yoder Red Hat 3 04-27-2005 09:26 AM
KDE works, but display isn't optimal. JustinCoyan Slackware 2 05-28-2004 12:28 PM
how this parameter works? elliore Linux - Newbie 2 07-01-2003 03:14 AM


All times are GMT -5. The time now is 12:55 AM.

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