LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   --display parameter never works (https://www.linuxquestions.org/questions/linux-desktop-74/display-parameter-never-works-727423/)

lilsim89 05-20-2009 08:55 PM

--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?

rnturn 05-20-2009 09:44 PM

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

lilsim89 05-21-2009 01:02 AM

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

rnturn 05-21-2009 08:57 AM

Quote:

Originally Posted by lilsim89 (Post 3547760)
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

i92guboj 05-21-2009 10:47 AM

Xauth give other users authority to reach your X serssion.. By default no one else can use it but its propietary.

rnturn 05-21-2009 01:17 PM

Quote:

Originally Posted by i92guboj (Post 3548272)
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.)

frenchn00b 05-26-2009 04:53 PM

Code:

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


All times are GMT -5. The time now is 06:14 PM.