Q:

Ownership of .Xauthority transferred to root

Somehow, while playing around with LightDM and Webkit Greeter, the ownership of the .Xauthority file in my home dir was given to the root user and I couldn't login because I hadn't the privilegues to lock the file.
I was able to regain ownership of the file and I could login again. (After several hours of reinstalling LightDM and it's greeters)
So now everything's working fine again. But I'd like to know how this happened. Is this a bug in LightDM or Webkit Greeter or something else?

A:

Almost certainly not, no. You either started an X session as root (not sure how you managed that) or simply used touch or otherwise wrote .Xauthority with sudo. For more details, you'd have to explain what you were actually doing.
Next time, don't reinstall anything, just delete the ~/.Xauthority file, it will be recreated automatically next time you log in:
sudo rm ~/.Xauthority

Then log in normally.

