8

I wanted to manually configure the internet settings & decided to seek help from this website. Ubuntu did not allow me to perform step 1 saying,

X: user not authorized to run the X server, aborting

so I logged in as superuser by executing sudo -s. Then I executed step 1. Suddenly all the tray icons disappeared & the only thing that was being displayed was the wallpaper. I wasn't able to shutdown/restart & chose to shutdown the laptop directly with power button. Upon restart, I had the following problems,

PROBLEMS :

  • I am able to login with a guest account.
  • I'm unable to login with my user account. Logging in brings me back to the login screen.

I am using ubuntu 13.04. How can I fix this?

sourav c.
  • 46,120

3 Answers3

19

To solve the problem:

Open a terminal window Ctrl + Alt + T and type in the commands:

cd ~
sudo chown username:groupname .Xauthority

(replace username and groupname with that of your own, usually your group name will be same as your username.)

Avoid running startx as root:

Since you started X system as root (by logging-in as root and using startx) the file .Xauthority in your user-home directory (~) got owned by the root, and that's the reason why you're stuck with log-in loops. And that's why you shouldn't run sudo startx. You can solve this by giving the ownership of the file back to your user as shown above.

Reference:

rusty
  • 16,917
1

I wanted to add something to precise's answer. I did exactly that but it wasn't enough in my case. If someone still can't log in after following precise's instructions, do this:

ls -l ~/.ICEauthority

If it says something like -rw------- 1 root root 684 may 9 11:56 /home/user/.ICEauthority, do

sudo chown user:user ~/.ICEauthority

where user is, of course, your username.

thorne
  • 61
  • 1
  • 5
0

I had the same problem, and tried multiple different ways to try and fix the problem. This is what best worked for me.

  • Press ctrl alt f1

  • Then login.

  • Type in

mv .Xauthority .Xauthority.bak

Sometimes, it may say that there is no such file or directory. DO NOT WORRY. Just move on to the next steps.

type in exit.

press ctrl alt f7 then try longing again.

Hope that helps!

schung
  • 49