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

Re: One last thing before I pass out



Here's what I do after 'su -':

% whoami
hessu
% echo $DISPLAY
:0
% su -
<type the root password>
# export DISPLAY=:0
# export XAUTHORITY=/home/hessu/.Xauthority
# xterm&

The X server wants a magic cookie (password string) by the client 
program to make sure that the client is allowed to connect to it. The 
magic cookies reside in users ~/.Xauthority file which MUST be readable 
only by the user.

Since root can read any file she/he wants, root can use anyones 
.Xauthority as shown above.

Another solution is to copy the user's .Xauthority file to root's 
.Xauthority file, but this is less secure since the user and root now 
share the same magic cookies.

Hope this helps.

// Heikki

Daniel Laffin wrote:
> 
> After su'ing in an xterm and trying to run any x app i get this.  I tried
> "xhosts -", but it still gives me this.  *scratches his head*  Sleep
> now--thanks.  =)
> 
> apollyon:/# xterm
> Xlib: connection to ":0.0" refused by server
> Xlib: Invalid MIT-MAGIC-COOKIE-1 key
> Error: Can't open display: :0.0
> Exit 1
> apollyon:/#



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