[LightDM] Magic cookie doesn't work - no protocol specified

Mikhail Morfikov
Wed, 18 Nov 2015 14:03:49 -0000

On 2015-11-18 06:17, Robert Ancell wrote:
> Hi Mikhail,
>
> It's hard to tell exactly what is wrong - if you attach both
.Xauthority
> files it will be easier to see the difference.
>
> Check what version of Xorg you are running and check it is actually
> enabling TCP connections - there was a behaviour change in X [1].
>
> --Robert
>
> [1] https://launchpad.net/bugs/1449282
>
>
> On Fri, 30 Oct 2015 at 16:45 Mikhail Morfikov <mmorfikov at
gmail.com> wrote:
>
>> When I start an X-session via startx on my debian distro, I can get the
>> output of the two following commands:
>>
>> $ xauth extract - $DISPLAY
>> morfikownia0MIT-MAGIC-COOKIE-1’E!ö½o`q!SD„%
>>
>> $ xauth extract - morfikownia.mhouse.lh:0.0
>> À¨–0MIT-MAGIC-COOKIE-1Ê¹2y0ºˆ%
>>
>> I know that the output is a little unreadable, but the most important
>> thing is that I get the output from the two commands above. When I send
>> that cookie to another machine using this command:
>>
>> $ xauth extract - morfikownia.mhouse.lh:0.0 | ssh -x morfik at
192.168.10.20
>> xauth merge -
>>
>> I can get access to this X-server from that machine, and everything
works
>> as expected.
>>
>> When I start am X-session via LightDM, the command:
>>
>> xauth extract - morfikownia.mhouse.lh:0.0
>>
>> returns nothing, or actually it gives me the following message:
>>
>> "No matches found, authority file "-" not written"
>>
>> I can, of course, use the following command to get the cookie:
>>
>> xauth extract - $DISPLAY
>>
>> and then send it via:
>>
>> $ xauth extract - $DISPLAY | ssh -x morfik at 192.168.10.20 xauth merge
-
>>
>> But in that case, when I try to connect remotely to this X-server,
I'm
>> unable to do it. I get a message that "no protocol
specified", and nothing
>> happens.
>>
>> I think I have the exact same options set in both cases, i.e. in the
>> /etc/X11/xinit/xserverrc file I have the following line:
>>
>> exec /usr/bin/X -auth "$HOME/.Xauthority" -listen tcp
"$@"
>>
>> And in the case of LightDM I have these options set in its config file
>> (/etc/lightdm/lightdm.conf):
>>
>> egrep -v ^# /etc/lightdm/lightdm.conf
>> [LightDM]
>> greeter-user=lightdm
>> minimum-display-number=0
>> minimum-vt=7
>> logind-check-graphical=true
>> log-directory=/var/log/lightdm
>> run-directory=/var/run/lightdm
>> cache-directory=/var/cache/lightdm
>>
>> [Seat:*]
>> xserver-command=X -listen tcp -auth "$HOME/.Xauthority"
>> xserver-allow-tcp=true
>> greeter-session=lightdm-gtk-greeter
>> greeter-hide-users=false
>> greeter-allow-guest=false
>> greeter-show-manual-login=true
>> greeter-show-remote-login=true
>> user-session=openbox
>> allow-user-switching=true
>> allow-guest=false
>> autologin-guest=false
>> autologin-user-timeout=0
>> autologin-in-background=false
>>
>> [XDMCPServer]
>>
>> [VNCServer]
>>
>> Do you know why it fails to connect to the X-server when LightDM is
used?
>> Is there a way to fix it?
>> _______________________________________________
>> LightDM mailing list
>> LightDM at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/lightdm
>>
>
I know that the default behavior of X-server changed in some version, but
I managed to set the server without any problem, and it was working when
started via "startx". You can see the settings that was set in the
/etc/lightdm/lightdm.conf file, and they were exactly the same as those
in the /etc/X11/xinit/xserverrc file. The problem was somewhere in "xauth
extract" because this command was working fine with "startx", but
it
didn't work well with lightdm.

> It's hard to tell exactly what is wrong - if you attach both
.Xauthority
> files it will be easier to see the difference.

I sent that message some weeks ago, and I don't have that setup anymore.
I could try to make another one, but you have to tell me if you want me
to issue some particular commands, or you want me to attach the full
.Xauthority files from both machines?