This is the mail archive of the cygwin-xfree@cygwin.com mailing list for the Cygwin XFree86 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: startx and ssh


In message <1060734367.15425.ezmlm@cygwin.com>,
Dr.D.J.Picton" <dave@aps5.ph.bham.ac.uk> said:
["Gary Nicholson" <holokin@sisna.com> said]
>> 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.
>
>> Does anyone have any feedback?
>
>I've seen the problem, and in my view there's a better solution.  Remove the
>code which sets XAUTHORITY.
>
>(I think the problem occurs because XWin assumes -auth $XAUTHORITY if the
>variable is set, then gets upset because it can't find the authorization
>key for your display.)

Even better, don't leave the X server wide open for everybody to screw
with.  The XFree-86 server includes the security extension (see
xdpyinfo) so you should be able to generate a proper X authentication
token for the display. Something like:

  xauth generate :0 .

or

  xauth add $DISPLAY . `mcookie`

added to the top of your ~/.xinitrc should do the trick.

				-- rouilj
John Rouillard
===========================================================================
My employers don't acknowledge my existence much less my opinions.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]