On Mon, 29 Jan 2007 09:04:38 +1100
Ken Wilson <[EMAIL PROTECTED]> wrote:

> here is help I recieved with this
> Ken
> 
> Ken,
> 
> I think that I have found the problem with your display. When you
> logged in as root you lost the authorization for the display. The
> long version can be found on this page...

But I haven't logged in as root. I just ssh -X in as myself. On one
machine the display gets reset properly (presumably by ssh?) but on the
other it doesn't. And I can't seem to find any real difference between
the two.

I also do X forwarding by ssh-ing into a Sun box. This also works
without problems. The Sun DISPLAY variable gets properly reset.

It is only my Xubuntu iBook that is being recalcitrant.

Thanks for the reference. Interesting stuff.
Alan

> 
> https://www6.software.ibm.com/developerworks/education/l-lpic1110/section4.html
> 
> You need to log in though. So here is an excerpt from that page.
> 
> Good luck
> 
> cheers
> 
> ----
> 
> Exporting a display
> 
> An X display is known by a name of the form
> hostname:displaynumber.screennumber. For Linux running on a
> workstation such as a PC, there is typically only one display with a
> single screen. In this case, the displayname may be, and usually is,
> omitted so the display is known as :0.0. The DISPLAY environment
> variable is usually set to the display name., so you can display it
> using the command echo $DISPLAY. Depending on your system, this
> variable may or may not be set if you use su - to switch to another
> user. In such a case, you may need to set and export the DISPLAY as
> shown in Listing 25. In this listing you see an attempt to start the
> xclock application after switching to root, but the attempt fails
> because the DISPLAY environment variable is not set. Even if the
> DISPLAY variable is set, you still may not be able to use the
> display, as you will also need authorization to do so.
> 
> 
> Listing 25. Attempting to start xclock
> 
> [EMAIL PROTECTED]:~> whoami
> ian
> [EMAIL PROTECTED]:~> echo $DISPLAY
> :0.0
> [EMAIL PROTECTED]:~> su -
> Password:
> lyrebird:~ # echo $DISPLAY
> 
> lyrebird:~ # xclock
> Error: Can't open display:
> lyrebird:~ # export DISPLAY=:0.0
> lyrebird:~ # echo $DISPLAY
> :0.0
> lyrebird:~ # xclock
> Xlib: connection to ":0.0" refused by server
> Xlib: No protocol specified
> 
> Error: Can't open display: :0.0
> lyrebird:~ # export XAUTHORITY=~ian/.Xauthority
> lyrebird:~ # xclock
> lyrebird:~ # ls -l ~ian/.Xauthority
> -rw-------  1 ian users 206 Feb 18 16:20 /home/ian/.Xauthority
> 
> 
> 
> Let's take a look at what is going on here. In this case, the user ian
> logged in to the system and his DISPLAY environment was set to :0.0
> as we expect. When user ian switched to user root, the DISPLAY
> environment variable was not set, and an attempt to start xclock
> failed because the application did not know what display to use.
> 
> So the substituted user, root, set the DISPLAY environment variable,
> and exported it so that it would be available to other shells that
> might be started from this terminal window. Note that setting and
> exporting an environment variable does not use the leading $ sign,
> while displaying or otherwise using the value does. Note too, that if
> the su command had omitted the - (minus) sign, the DISPLAY
> environment variable would have been set as it had been for user ian.
> Nevertheless, even with the environment variable set, xclock still
> failed.
> 
> The reason for the second failure lies in the client/server nature of
> X. Although root is running in a window on the one and only display
> on this system, the display is actually owned by the user who logged
> in originally, ian in this case. Let's take a look at X authorization.
> 
> 
> 
> 
> 
> 
> 
> 
> Alan L Tyree wrote:
> > On Sun, 28 Jan 2007 18:42:00 +1100
> > Sam Lawrance <[EMAIL PROTECTED]> wrote:
> > 
> >> On 28/01/2007, at 5:27 PM, Alan L Tyree wrote:
> >>
> >>> On Sun, 28 Jan 2007 16:54:52 +1100
> >>> Sam Lawrance <[EMAIL PROTECTED]> wrote:
> >>>
> >>>> On 28/01/2007, at 4:44 PM, Alan L Tyree wrote:
> >>>>
> >>>>> I have been trying to install x11vnc and then use ssh tunnels to
> >>>>> connect. There are two different machines that I am trying to
> >>>>> connect to, one Ubuntu and one is an Apple iBook running
> >>>>> Xubuntu.
> >>>>>
> >>>>> 1 I have no problem with either machine NOT using ssh
> >>>>>
> >>>>> 2 using ssh: ssh -L 5900:localhost:5900 remote_name 'x11vnc
> >>>>> -localhost -display :0'
> >>>>>
> >>>>>         Works great with the Ubuntu machine
> >>>>>
> >>>>>         Does not work with the Xubuntu machine (vncviewer
> >>>>> localhost:0 appears to connect, but there is no display)
> >>>>>
> >>>>> I presume it must be some setting in ssh, but I can't see any
> >>>>> difference.
> >>>>>
> >>>>> Can anyone help?
> >>>> Try using the verbose flag to ssh and/or x11vnc, and compare the
> >>>> two machines.
> >>> Hmm. I can't do a simple X forwarding to the Xubuntu machine.
> >>>
> >>> [EMAIL PROTECTED]:~$ ssh -v -X misty emacs
> >> ...
> >>> emacs: standard input is not a tty
> >> I think the original problem lies elsewhere - that's an expected  
> >> error, see the SSH manpage regarding tty / pty allocation and the
> >> -t option.
> > 
> > It fails with all programs.
> > 
> > The problem is that the DISPLAY variable is not getting set. After
> > logging into both machines with ssh -X machine_name
> > 
> > -----------------------------
> > [EMAIL PROTECTED]:~$ echo $DISPLAY
> > localhost:10.0              ** Ubuntu machine where everything
> > works -----------------------------
> > [EMAIL PROTECTED]:~$ echo $DISPLAY
> >                     ** Xubuntu machine where nothing works
> > [EMAIL PROTECTED]:~$
> > ------------------------------
> > 
> > The /etc/ssh/sshd_config files are the same in both machines.
> > 
> > I don't know how DISPLAY gets set
> > 
> > 
> 


-- 
Alan L Tyree                    http://www2.austlii.edu.au/~alan
Tel: +61 2 4782 2670            Mobile: +61 427 486 206
Fax: +61 2 4782 7092            FWD: 615662
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to