Announcement

Collapse
No announcement yet.

Could Not Login due to Corrupt .Xauthority

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Could Not Login due to Corrupt .Xauthority

    My problems all started when I could not login to my Laptop which has Kubuntu 13.10. I would enter the password and the screen would go for about 1s and then return with the login window. I reinstalled and there was no difference. I could login to the guest and I could also use startx from a host terminal in the recovery mode to login as well. I used this mode to rename my .kde file so that I could get it to start a new .kde on reboot. This made no difference.

    After pursuing many dead ends and getting to the point of even contemplating doing a 13.04 installation, I decided to go to my other "Sacrificial Desktop" with saucy and copy the .bashrc, .bash_logout and the .Xauthority onto a usb stick. I then copied these into my Laptop home directory and then rebooted sucessfully. I have the same user name and password on both systems but the hostname is different. I tried my old .Xauthority file and once again I could not login. This new .Xauthority file has the hostname of my "Sacrificial Desktop" but this does not seem to cause any problem.

    As there are many on this forum with more expertise than I, I am wondering if I have taken the correct approach or is there some more elegant way to create a new .Xauthority file. I have no idea why this happened except that there was one instance where I had 99.5GBytes of log files generated akonadi after I disabled it because virtuoso-t was hogging resources - I hope i have this right as I have been trying a lot of alternative approaches and getting very frustrated.

    #2
    Code:
    $ HOST=`hostname`
    $ key=`perl -e 'srand; printf int(rand(100000000000000000))'`
    $ key=$key$key
    $ xauth add ${HOST}/unix:0 . $key
    xauth:  creating new authority file /home/<user>/.Xauthority
    xauth: (argv):1:  key contains odd number of or non-hex characters
    $ sudo chmod 777 /home/<user>/
    I found this when I googled "create new .Xauthority" I'm kinda iffy on root chmod'ing my home directory.
    Last edited by Buddlespit; Sep 23, 2013, 04:46 AM.
    I do not personally use Kubuntu, but I'm the tech support for my daughter who does.

    Comment


      #3
      all you half to do is delete it ,,,,a new one will be generated on login .

      usually this happens from running a GUI app with sudo and then doing things in your /home with it !!

      VINNY
      i7 4core HT 8MB L3 2.9GHz
      16GB RAM
      Nvidia GTX 860M 4GB RAM 1152 cuda cores

      Comment


        #4
        Yes, I agree with you on that matter. However I do not plan to do another install in the near future as this afternoon I will be using my Laptop for a presentation and then again on Sunday. So I do not want to try any other ideas until after these events. It was unfortunate that it took me so long to realize that .Xauthority was the reason for my problems and I was starting to be concerned on how to meet these responsibilities. I even considered reverting back to 13.04!!!!

        One approach that I was considering was to see what would happen when I used the .Xauthority in the Guest area for my home area with the correct permissions set. I would like a simple solution without having to do a re-install. I have files that give me all that needs to be done for an installation and I get through this fairly quickly, however after doing this a number of times it becomes tedious.

        Comment


          #5
          The 'simple solution' is as vinny pointed out -- just delete the .Xauthority file from a console login. When not present, it gets rebuilt at log in.
          Using Kubuntu Linux since March 23, 2007
          "It is a capital mistake to theorize before one has data." - Sherlock Holmes

          Comment


            #6
            Originally posted by Snowhog View Post
            The 'simple solution' is as vinny pointed out -- just delete the .Xauthority file from a console login. When not present, it gets rebuilt at log in.
            Looks like I need to improve my reading and comprehension. I have just done what vinny pointed out and all is well. Thanks VERY MUCH.

            Comment


              #7
              Its happened again!!!!

              Originally posted by vinnywright View Post
              all you half to do is delete it ,,,,a new one will be generated on login .

              usually this happens from running a GUI app with sudo and then doing things in your /home with it !!

              VINNY
              Firstly, thanks for putting me in the right direction to fix my login problem. After deleting the .Xauthority I had no problems logging in. However after doing this I have had another two occasions where I could not login and had to repeat the procedure.

              I do use sudo in Konsole Terminal in my home directory for update and dist-upgrade as I prefer the detail provided by this approach rather than using muon. I would be disappointed if the system has been changed so that one is "punished" in this way for doing a sudo.

              Comment


                #8
                Using sudo in a console to start a 'non-GUI' application, of which apt-get is, doesn't present any problems. Using sudo to start a GUI application "may" result in problems with the users account.
                Using Kubuntu Linux since March 23, 2007
                "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                Comment


                  #9
                  the next time it happens check who owns the file .
                  it's a magic cookie to allow connection to the x server ,,,, some how it is geting taken over .

                  VINNY
                  i7 4core HT 8MB L3 2.9GHz
                  16GB RAM
                  Nvidia GTX 860M 4GB RAM 1152 cuda cores

                  Comment


                    #10
                    Finally fixed the .Xauthority problems

                    I have had may cases of .Xauthority being corrupt in the last couple of days.

                    Case 1: Yesterday I had a doctors appointment and had to be there 2 hours before hand for the procedures involved in a test. So I took my Laptop to do work during that period. I was not able to login because of a corrupt .Xauthority. I could only fix this problem if connected to the Internet by an Ethernet connection. I have a separate home partition and I can only access this partition when I have a network connection.

                    Case 2: This morning, I decided to reinstall the latest beta 2 on my All-in-One Desktop. After doing all the NFS connections by editing the /etc related files, a subsequent login failed because of .Xauthority. Because this Desktop was in a separate part of the house with only wireless connection, I had to disconnect it and take it to the router where I had a spare Ethernet connection so that I could delete .Xauthority.

                    Case 3: I came home tonight to do an email and once again .Xauthority stopped me from logging on.

                    I tried to create another user by using System Settings in the hope that I could access my home directory but this failed. By this time I was furious and was starting to wonder what earthly use this .Xauthority had?

                    My solution was to edit .bash_logout and add the line
                    Code:
                    rm /home/username/.Xauthority
                    I have checked that this line works and have now added it to both systems that have 13.10.

                    I will let you know if this solution does not work. But I have every expectation that my problems with .Xauthority are over.
                    Last edited by NoWorries; Oct 02, 2013, 05:30 AM.

                    Comment


                      #11
                      Originally posted by NoWorries View Post
                      I have had may cases of .Xauthority being corrupt in the last couple of days.

                      Case 1: I could only fix this problem if connected to the Internet by an Ethernet connection. I have a separate home partition and I can only access this partition when I have a network connection.
                      could you elaborate on this ,,,,,I do not see how just having a separate /home is cause for needing a network connection to access it.
                      Originally posted by NoWorries View Post
                      Case 2: This morning, I decided to reinstall the latest beta 2 on my All-in-One Desktop. After doing all the NFS connections by editing the /etc related files, a subsequent login failed because of .Xauthority. Because this Desktop was in a separate part of the house with only wireless connection, I had to disconnect it and take it to the router where I had a spare Ethernet connection so that I could delete .Xauthority.
                      could you explane exactly how you did your editing of the "/etc related files" !!

                      Originally posted by NoWorries View Post
                      Case 3:

                      I tried to create another user by using System Settings in the hope that I could access my home directory but this failed. By this time I was furious and was starting to wonder what earthly use this .Xauthority had?
                      how did this fail ? but the new user couldent have changed it anyway unless thay were in your group

                      did you check
                      Code:
                      ls -la ~/
                      and see who owned the .Xauthority ................like I sead it is a magick cookie that authorizes you to conect to the Xserver ,,,if root becomes the owner of it then YOU cant log in .....

                      VINNY
                      i7 4core HT 8MB L3 2.9GHz
                      16GB RAM
                      Nvidia GTX 860M 4GB RAM 1152 cuda cores

                      Comment


                        #12
                        Originally posted by vinnywright View Post
                        could you elaborate on this ,,,,,I do not see how just having a separate /home is cause for needing a network connection to access it.
                        VINNY
                        What I have found is that when I go into recovery mode and select root, and then cd /home followed by ls nothing is listed. I have to have an ethernet connection and select network. After doing this I enter root and do [i]startx[/] as I find this faster to get to my home directory and delete [i]Xauthority[/]. I am sure that I could do the same using the command line and not use startx.

                        My system is setup with separate partitions for root and home. The ownership of the .Xauthority file is User = Username and Group = Username

                        Originally posted by vinnywright View Post
                        could you explane exactly how you did your editing of the "/etc related files" !!
                        VINNY
                        In this case I use Konsole and cd /etc followed by sudo nano filename where filename is either exports, fstab, hosts, hosts.allow, hosts.deny. I have text files in my home directory with the same name and which contain the text to copy and paste into the nano edit window. This allows me to use Dolphin to view all files on all computers in my home network.

                        Originally posted by vinnywright View Post
                        how did this fail ? but the new user couldent have changed it anyway unless thay were in your group

                        did you check
                        Code:
                        ls -la ~/
                        and see who owned the .Xauthority ................like I sead it is a magick cookie that authorizes you to conect to the Xserver ,,,if root becomes the owner of it then YOU cant log in .....
                        VINNY
                        When I did ls . . . . I only saw root and Username listed. I did not spend a lot of time trying to create a new user in the same group using System Settings. The new user is listed in the login screen but I cannot login and I cannot find any directories in the /home partition related to the new user. I considered the possibility of having another user with access to my home partition, but then there is the problem of being confident to not have a corrupt Xauthority in the new user area.

                        That is why I decided to edit the bash_logout and use it to remove Xauthority every time I logout.

                        Comment


                          #13
                          Originally posted by NoWorries View Post
                          What I have found is that when I go into recovery mode and select root, and then cd /home followed by ls nothing is listed.
                          is your separate home partition mounted automatically when you boot into recovery mode (that might explain why /home is empty)

                          Originally posted by NoWorries View Post
                          When I did ls . . . . I only saw root and Username listed
                          Normally everything (except ".." which refers to parent directory) in user's home directory should be owned by the user

                          Originally posted by NoWorries View Post
                          That is why I decided to edit the bash_logout and use it to remove Xauthority every time I logout.
                          That won't work in cases where .Xauthority is owned by root (which is in my experience by far the most common issue with xauth...although easily avoided), as the user doesn't have the permissions to remove root owned .Xauthority.

                          Wrote without thinking , user can remove the file it s/he has write access to the directory (as s/he normally does), but it'll prompt for confirmation...which you can override with the -f option.
                          Last edited by kubicle; Oct 03, 2013, 01:40 AM.

                          Comment


                            #14
                            Originally posted by kubicle View Post
                            That won't work in cases where .Xauthority is owned by root (which is in my experience by far the most common issue with xauth...although easily avoided), as the user doesn't have the permissions to remove root owned .Xauthority.
                            I have never had .Xauthority owned by root. The ownership was the first aspect that I checked when trying to resolve the problem. In all cases, it was owned by Username. The attached graphics show the permissions and the advanced permissions on the file create at login.
                            Attached Files

                            Comment


                              #15
                              Originally posted by NoWorries View Post
                              I have never had .Xauthority owned by root.
                              Even when you couldn't login? Sorry for the side steps, I didn't actually read (I'll do that now) the whole thread so I don't actually have all the info of your problems.

                              btw, edited, my original post.

                              Comment

                              Working...
                              X