1

When I try to login to my ubuntu 12.04 it accepts my account info and password but then a black terminal page appears and disappears very fast and it goes back to login page.
I killed lightdm and then used this command:

sudo lightdm

then tried to login (while terminal keeps the log). this is the error I receive:

Warning **error reading existing Xauthority: Error opening file : Permission denied Error writing X authority:Error opening file ,/home/sam/.Xauthority': Permission denied

All of this started when I pressed M in answer to this question during boot.
The Disk Drive for /tmp is not ready yet. S to skip mount or M for manual recovery

Here is the result to sudo df /etc/fstab

Here the result for sudo cat /etc/fstab

ask for more info if needed

girardengo
  • 5,005
Sam
  • 119
  • 1
  • 7

1 Answers1

9

Thanks to a friend on #ubuntu freenode channel I fixed this problem.
First run this command to make sure your problem is same as mine:

ls -l .Xauthority 

I got root:root as owner of .Xauthority which is the reason for me not being able to login from gui.
The owner should be like username:username.
Run this in Alt+Ctrl+F2 as root:

sudo chown user:user /home/user/.Xauthority

now you can login.

The reason for this error is that you probably run graphical programs through sudo like I used this command sudo gedit /etc/apt/sources.list should have used gksudo gedit /etc/apt/sources.list

girardengo
  • 5,005
Sam
  • 119
  • 1
  • 7