12

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?

s3lph
  • 14,644
  • 12
  • 60
  • 83

2 Answers2

11

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.

terdon
  • 104,119
3

It happened to me too. I think that it could be caused by running

sudo graphic_application

instead of

gksudo graphic_application 

for some (unknown) app. There is a paragraph in the sudo help page about that... scroll down to "Graphical sudo".

See also What is the difference between "gksudo nautilus" and "sudo nautilus"?

Rmano
  • 32,167