public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Jon TURNEY <jon.turney@dronecode.org.uk>
To: cygwin@cygwin.com
Cc: Andrew DeFaria <Andrew@DeFaria.com>
Subject: Re: X11Forward and xauth problems
Date: Thu, 26 Mar 2015 20:39:00 -0000	[thread overview]
Message-ID: <55145A0D.4010406@dronecode.org.uk> (raw)
In-Reply-To: <meurth$g26$1@ger.gmane.org>

On 25/03/2015 17:40, Andrew DeFaria wrote:
> Prediction: This problem probably will end up having something to do
> with the permissions and file system that ~/.Xauthority resides on,
> which is, I believe, a NetApp. This file system is the file system for
> the Linux Home directories (Windows "home" directories are somewhere
> else). In an attempt to have a transparently workable environment I set
> my Cygwin home directory to access the same directory my Linux servers
> use for the home directory - this NetApp. If you need more information
> about that then let me know and perhaps tell me how I can get that.

This seems very plausible.

If I am understanding you correctly, ~/.Xauthority is the same file on 
the NetApp at both ends.  I think perhaps that is somehow the cause of 
the problem.

The sequence of actions is something like:

- startx(|win) generates a random cookie and stores it in 
~/.serverauth.<pid> and uses that file as the server -auth option
- it also uses 'xauth add' to put that cookie into ~/.Xauthority for the 
display (e.g. :0)
- ssh reads that cookie out of ~/.Xauthority using 'xauth list' and 
sends it to the far end
- sshd tries to store that cookie using xauth for the proxy display (e.g 
:10)

Reading the source of xauth [1], it does try to lock the ~/.Xauthority 
file for up to 20 seconds before giving up, which perhaps corresponds to 
the delay you see?

However, the "unable to link authority file .Xauthority, use 
.Xauthority-n" message indicates that the working file .Xauthority-n 
cannot renamed as .Xauthority (xauth tries both to hard-link it as 
.Xauthority, and to rename it)

Of course, sshd doesn't understand it's helpful advice to use a 
different filename, so things don't work out so well. :)

Given that it works the first time, when there is no existing 
~/.Xauthority, perhaps the NetApp doesn't permit this file to be renamed 
over an existing file, for some reason?

You can tell startx to use a different file by using the XAUTHORITY env 
var, so setting that to something like ~/.Xauthority-$HOSTNAME might be 
a workaround. (Some googling on 'Xauthority hostname nfs' might be 
informative)

Or editing startx and changing enable_xauth to 0 might also be a workaround.

> As you can see with my current ~/.Xauthority file things don't work. But
> if I remove them, the ~/.Xauthority* files one is created at the next
> login and everything works fine. Log out and back in however and it
> breaks again.

>>>> If you want this to work, you will now (since X server 1.17) need to
>>>> start the server with the option '-listen tcp'.
>>>
>>> Restarted Xwin with -multimonitor and -listen tcp. Now I get:
>>
>> Sorry for any ambiguity, but you have misunderstood what I wrote.
>>
>> If you want explicitly setting DISPLAY and allowing access using xhost
>> to work, you must start the server with the option '-listen tcp'.
>
> Sorry I misunderstood. This works for me and is a work around. But I
> wish I could get that xauth thing working correctly.

Good.

[1] http://cgit.freedesktop.org/xorg/app/xauth

-- 
Jon TURNEY
Volunteer Cygwin/X X Server maintainer

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

  reply	other threads:[~2015-03-26 19:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-23 21:06 Andrew DeFaria
2015-03-23 21:26 ` Jon TURNEY
2015-03-23 22:03   ` Andrew DeFaria
2015-03-24 13:35     ` Jon TURNEY
2015-03-25 22:11       ` Andrew DeFaria
2015-03-26 20:39         ` Jon TURNEY [this message]
2015-03-26 22:17           ` Andrew DeFaria
2015-03-27  3:12             ` Andrew DeFaria
2015-03-30 13:40             ` Jon TURNEY

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55145A0D.4010406@dronecode.org.uk \
    --to=jon.turney@dronecode.org.uk \
    --cc=Andrew@DeFaria.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).