XAuthority Error

6,353

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

Share:
6,353

Related videos on Youtube

Sam
Author by

Sam

Updated on September 18, 2022

Comments

  • Sam
    Sam over 1 year

    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

    • Sam
      Sam about 10 years
      @Simptnon I tried that didnt solve my problem still cannot login
    • Sam
      Sam about 10 years
      I post my lightdm link again seems like there was something wrong with last one. paste.ubuntu.com/7413054 I made a new user with this command now I can use my pc but wish I could recover last one
    • Sam
      Sam about 10 years
      @Xubu-Tur my graphic seems lower since I fixed this problem. maybe a graphic driver is also root permission and isn't running?? any fix to that?? I don't really know what is my ubuntu graphic driver otherwise I would reinstall it
    • Sam
      Sam about 10 years
      some of hight definition videos that I could view easily before break and view large pixels. paste.ubuntu.com/7418886
  • Wilf
    Wilf almost 10 years
    You can mark the question as answered if you want then :)