Unix questions - Screen in an Xterm -- su & running browser

This is Interesting: Free IT Magazines  
Home > Archive > Unix questions > March 2004 > Screen in an Xterm -- su & running browser





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Screen in an Xterm -- su & running browser
Alan Connor

2004-03-26, 11:46 am


I run my box (Linux/Debian) from Screen running in an x-terminal-emulator called "aterm".
The 'xterm' opens in a window created by a light window manager, flwm.

When I login, startx runs calling aterm with Screen running in it.

No problem using my graphical browser Dillo when I am running as myself, no matter which pty
I am in at the moment: Dillo opens in a seperate window.

But if I create a new pty and su - another_user, Dillo will not run.

$ export DISPLAY=:0.0
$ dillo index.html
Xlib: connection to ":0.0" refused by server
Xlib: Invalid MIT-MAGIC-COOKIE-1 key

Gtk-WARNING **: cannot open display: :0.0

(and a variety of other similar messages with different DISPLAY variations
-- with some, Dillo seems
to start, but isn't really, because TOP says nothing about it, but I have
to use ^C to get the prompt back)

The weird thing is that I used to startx from this user account, and copied
the ~/.Xauthority file with the "magic cookie" FROM this user to my account
and it works fine there if I startx from there, which I do now.

$ echo $DISPLAY

from the main user account gives: :0.0

Any clues appreciated. I want to be able to su to that user in Screen and
run the browser there.

While you are reading this, I am reading through the forest of X man pages...

AC

Chris F.A. Johnson

2004-03-26, 11:46 am

On Fri, 26 Mar 2004 at 08:05 GMT, Alan Connor wrote:
>
> I run my box (Linux/Debian) from Screen running in an x-terminal-emulator called "aterm".
> The 'xterm' opens in a window created by a light window manager, flwm.
>
> When I login, startx runs calling aterm with Screen running in it.
>
> No problem using my graphical browser Dillo when I am running as myself, no matter which pty
> I am in at the moment: Dillo opens in a seperate window.
>
> But if I create a new pty and su - another_user, Dillo will not run.
>
> $ export DISPLAY=:0.0
> $ dillo index.html
> Xlib: connection to ":0.0" refused by server
> Xlib: Invalid MIT-MAGIC-COOKIE-1 key
>
> Gtk-WARNING **: cannot open display: :0.0



xhost localhost


--
Chris F.A. Johnson http://cfaj.freeshell.org/shell
========================================
===========================
My code (if any) in this post is copyright 2004, Chris F.A. Johnson
and may be copied under the terms of the GNU General Public License
Alan Connor

2004-03-26, 11:46 am

On Fri, 26 Mar 2004 08:05:45 GMT, Alan Connor <zzzzzz@xxx.yyy> wrote:
>
>
>
> I run my box (Linux/Debian) from Screen running in an x-terminal-emulator called "aterm".
> The 'xterm' opens in a window created by a light window manager, flwm.


Got it!

Somehow, when I started running startx from this account, the magic cookie in the .Xauthority
file was re-written. I copied it to the other users $HOME as root and made it owned by
thatuser:thatuser and all is well.

Later,

AC

Alan Connor

2004-03-26, 11:46 am

On 26 Mar 2004 09:03:07 GMT, Chris F.A. Johnson <c.fa.johnson@rogers.com> wrote:
>
>
> On Fri, 26 Mar 2004 at 08:05 GMT, Alan Connor wrote:
>
>
> xhost localhost


Thanks Chris. I've been reading the man (7) Xsecurity page, and if the cookie bit
hadn't worked was thinking that would be the one to experiment with.

In fact, I did, briefly, and it rejected the username.....Didn't think to try "localhost".

I suspect that the use of the ~/.Xauthority with Magic Cookie with startx may block the use
of xhost, that I would have to remove that file and then reboot the Xserver and put something
like exec xhost + in that ~/.bashrc.



AC

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com