0

I've just got the same problem from here, and solved it using what was stated in the first answer (akonsu's one).

However, I would love to know why ~/.Xauthority needs not to be owned by the root account in order to get past login with a regular user (in other words: why is that the reason for the login failure), and - do you have an assumption as to how akonsu found that as a solution?

1 Answer 1

1

This is part of the mechanism used by X server to authenticate client programs.

refer to X Window authorization

The cookie-based authorization methods are based on choosing a magic cookie (an arbitrary piece of data) and passing it to the server when it is started; every client that can prove having knowledge of this cookie is then authorized connection to the server.

These cookies are created by a separate program and stored in the file .Xauthority in the user's home directory, by default. As a result, every program run by the client on the local computer can access this file and therefore the cookie that is necessary for being authorized by the server. If the user wants to start an application from another computer on the network, the cookie has to be copied to that other computer.

when ~/.Xauthority is owned by the root account, normal X client programs couldn't read it and wouldn't be authenticated by X server. this mostly leads to crash.

3
  • Thanks. Do you have a guess why the permissions changed? This is a clean install, and at some point I ran the startx command.
    – Reflection
    Jan 18, 2014 at 17:01
  • Can someone make an assumption?
    – Reflection
    Jan 24, 2014 at 15:11
  • @Reflection I just ran into a very similar problem. The reason my .Xauthority was changed to owned by root was because I had tried running startx, saw the error message "user not authorized to run the X server, aborting" and then tried sudo startx. This was what changed the ownership of .Xauthority. Maybe you did the same thing?
    – Sean
    Feb 18, 2014 at 22:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .