You are not logged in.
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
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
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
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
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