Re: X windows not working for root user
Jens.Toerring_at_physik.fu-berlin.de
Date: 05/19/04
- Next message: Suresh: "Moving multithreaded application to multiprocessing application"
- Previous message: moma: "Re: dlopen() and putenv()"
- In reply to: user_at_domain.invalid: "X windows not working for root user"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 19 May 2004 08:19:50 GMT
user@domain.invalid wrote:
> I have installed a new debian KDE distribution.
> I log in as a user and everything works fine.
> I then open a shell and use 'su' to change to root.
> Then as root I can't run any program that want to use
> a X window.
> Below is what is display on the shell.
> --- snip ---
> Xlib: connection to ":0.0" refused by server
> Xlib: Invalid MIT-MAGIC-COOKIE-1 key
> (gedit:28819): Gtk-WARNING **: cannot open display
> --- snip ---
> Any ideas what might be wrong?
Nothing is wrong. But normally only the logged in to the graphical
inter face user has access to the display. That's for security rea-
sons, if every user could get at it (and Linux is a real multi-user
system, so there could be dozens of other users logged in at the
same time, e.g. via a terminal) then they all would have a chance
to see what you're doing, including e.g. logging each of your key-
strokes. And that's something that is made impossible by default.
But there's a simple solutions: put something like
alias r='su - -c "xauth merge $HOME/.Xauthority;export DISPLAY=:0.0;xterm"'
into your .alias file (assuming you're using bash) and use that new
'r' command when you want to become root with access to the graphical
stuff.
Another, less secure method is to allow everyone on the local
machine access to the graphical interface by
> xhost +localhost
and then you have to set the DISPLAY variable after 'su' with
# export DISPLAY=:0.0
Regards, Jens
-- \ Jens Thoms Toerring ___ Jens.Toerring@physik.fu-berlin.de \__________________________ http://www.toerring.de
- Next message: Suresh: "Moving multithreaded application to multiprocessing application"
- Previous message: moma: "Re: dlopen() and putenv()"
- In reply to: user_at_domain.invalid: "X windows not working for root user"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|