This is the mail archive of the
cygwin-xfree@cygwin.com
mailing list for the Cygwin XFree86 project.
startx and ssh
- From: "Gary Nicholson" <holokin at sisna dot com>
- To: <cygwin-xfree at cygwin dot com>
- Date: Mon, 11 Aug 2003 12:55:05 -0600
- Subject: startx and ssh
- Organization: Holistic Kinesiology
- Reply-to: cygwin-xfree at cygwin dot com
- Reply-to: <holokine at holokine dot com>
I have been trying to de-bug a problem with startx.
When I tried to run the file, I would get a server window,
no clock and no terminal windows. The command-line
errors were:
..
Xlib: connection to "0.0" refused by server
Xlib: No Protocol specified
These error messages would repeat until I hit ^Z
from the console command line.
I found that the script would fail if a .Xauthority file
existed in my home directory. If I removed the file,
startx ran without errors; the server, the clock and
the terminal windows all opened successfully when
there was no .Xauthority file in my home directory.
I found that the .Xauthority file was being created
when I logged onto my Cygwin machine from another
machine using ssh with the same login name.
I am proposing a fix for this problem:
In /usr/X11R6/bin/startx, add the following code before
the block that exports the XAUTHORITY variable:
# remove $HOME/.Xauthority if it exists
if [ -f $HOME/.Xauthority ]; then
rm $HOME/.Xauthority
fi
This code just removes .Xauthority if it exists.
If .Xauthority doesn't exist, it does nothing.
I tested whether removing the file would disrupt
a running ssh session; it didn't.
Some content causes errors; some content may not.
(When I followed the rm $HOME/.Xauthority command
with a touch $HOME/.Xauthority command,
the X server and xterms started without errors. Can
someone explain that?)
When a client tries to create an ssh session, xauth
will create a new .Xauthority file, if one does not exist.
One email in the archives suggested avoiding startx
altogether, in favor of xinit. Using xinit gave me no
problems, even when .Xauthority was present.
I just wanted to find out, for my own reasons, why
startx was not working.
Does anyone have any feedback?
Is there a down-side to removing .Xauthority which I
haven't considered? Is there some reason this fix won't
work? Has anyone done something that solves this
problem more elegantly?
Gary