[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Xemacs wont run under SU, is it normal?



On Tue, 2 Sep 1997, Alfonso E. Urdaneta wrote:

> lc29b50 wrote:
> > 
> > After I execute the su command to switch to root, when I run Xemacs, it
> > gives me an error message(something related to xlib6) and won't run. Is
> > this normal?
> > 
> 
> Try opening another window and typing "xhost +".
> 
> When you su, you become a different user, who does not own the screen. 
> The call to xhost will allow anyone to display on your screen.

The problem with this is, that 'everyone' is not limited to users logged
in on your computer. If you use it, and it works, this means that anyone
can access your display. This includes reading every key you touch on your
keyboard, so it will be easy for a hacker to catch any passwords you type
under X.

A better method is using authorisation 'cookies'. I think this is the
default in Debian 1.3 if you use startx to start X. It definately is the
standard if you are using xdm to manage the display. If somebody tries to
access the display he will get

Xlib: connection to ":0.0" refused by server
Xlib: Client is not authorized to connect to Server
Error: Can't open display: :0

or

Xlib: connection to ":0.0" refused by server
Xlib: Invalid MIT-MAGIC-COOKIE-1 key
Error: Can't open display: :0

If this is what you are getting when you try to run Xemacs as root, make a
script that does something like this:

#!/bin/sh
if [ X$DISPLAY = X ]
then
    echo "The DISPLAY environment variable is not set."
    echo "Please set it first."
    exit 1
fi
su <name_of_user> -c "xauth nlist $DISPLAY" | xauth nmerge -

<name_of_user> should be the name of the user that runs X. In my case this
always the same, so I didn't make this a command line option for the
script.

Take a look at 'man xauth' for more details.

Remco
--
System Error, hit any user to continue


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: