You are not logged in.

#1 2004-05-02 10:29:06

monolin
Member
Registered: 2004-03-06
Posts: 31

how to make root launch X11 programs under users' desktop?

Every time when I want to launch X11 programs such as mozilla from a user's terminal, I have to copy .Xauthority of that user into root home dir first.
Otherwise the error occur:

Xlib: connection to ":0.0" refused by server
Xlib: Invalid MIT-MAGIC-COOKIE-1 key

(firefox-bin:1718): Gtk-WARNING **: cannot open display:


Is there anyway to launch X11 programs directly from the user's terminal after su root ?


When false is taken for true, true becomes false;
If non-being turns into being, being becomes non-being.

Pages full of fantastic talk
Penned with bitter tears;
All men call the author mad,
None his message hears.

Offline

#2 2004-05-02 17:33:52

kakabaratruskia
Member
From: Santiago, Chile
Registered: 2003-08-24
Posts: 596

Re: how to make root launch X11 programs under users' desktop?

That happened to me when I used kdm. If you start X with either startx or gdm, that does not happen (at least it worked for me).


And where were all the sportsmen who always pulled you though?
They're all resting down in Cornwall
writing up their memoirs for a paper-back edition
of the Boy Scout Manual.

Offline

#3 2004-05-02 17:58:44

zezaz
Member
From: Bordeaux, France
Registered: 2004-04-26
Posts: 80
Website

Re: how to make root launch X11 programs under users' desktop?

1st method (short):

when login as root:

export DISPLAY=:0.0
export XAUTHORITY=/home/other_user/.Xauthority

2nd method (long):

- install ssh
- change sshd config to enable X11 forwarding
- (mandatory for security) block ssh from outer hosts with your firewall
- run sshd at startup
- login with:

ssh -X -l root localhost

Offline

#4 2004-05-02 22:39:27

farphel
Forum Fellow
From: New Hampshire - USA
Registered: 2003-09-18
Posts: 250
Website

Re: how to make root launch X11 programs under users' desktop?

zezaz wrote:

1st method (short):

when login as root:

export DISPLAY=:0.0
export XAUTHORITY=/home/other_user/.Xauthority

As your user that is logged into the console, add a

xhost +localhost

to your .xinitrc file (you may need to add this to some other startup script if you use gdm/kdm/xdm).

Then as your su'd user, just enter

export DISPLAY=localhost:0

at your shell.

This is probably the the preferred way rather than pointing to another user's .Xauthority file.


Follow the link below, sign up, and accept one promotional offer.  If I can get five suckers (err... friends) to do this, I'll get a free iPod.  Then you too can try to get a free iPod. Thanks! http://www.freeiPods.com/?r=11363142

Offline

#5 2004-05-03 20:30:46

Xentac
Forum Fellow
From: Victoria, BC
Registered: 2003-01-17
Posts: 1,797
Website

Re: how to make root launch X11 programs under users' desktop?

I use sudo.


I have discovered that all of mans unhappiness derives from only one source, not being able to sit quietly in a room
- Blaise Pascal

Offline

Board footer

Powered by FluxBB