Results 1 to 7 of 7

Thread: 12.04 - Crashes upon log-in

  1. #1
    Join Date
    Aug 2013
    Beans
    11

    Question 12.04 - Crashes upon log-in

    Not sure where to put this so I put it here. Anyway, I've got a slight (slight = major) problem with Ubuntu 12.04 which is a real pain.

    1) The Problem:
    Ubuntu 12.04 boots normally to the log-in screen where I can select either "james" or "Guest Session". "Guest Session" works normally but it has very limited privileges and logging into my account just doesn't work. As soon as that password is entered, BAM! That screen flashes up, the one you often see when shutting down that just shows stuff like that the Apache server has started correctly or whatever and then I'm back at the log-in screen. Entering the password again results in the same loop, just without flashing that little bit of unhelpful text.

    2) Why I (unintentionally) broke everything:
    Well, I ssh into a VPN but when it is "destroyed" and brought back, the MAC address or something changes, I'm not 100% sure what it is. Anyway, this causes something to not match up with ~/.ssh/known_hosts which stops me from connecting due to a suspected, yet non-existent, man in the middle attack unless I delete or edit that file. So I decided to try and fix that...

    3) How I (might have) caused it:
    So, I attempted to set up a way for the known_hosts file to be deleted automatically every time I used the ssh command as briefly explained in the previous section of this post. Trying things out to see what works, like you do, I went into the .bashrc file in the home directory (while not root if that matters) and put ssh=rm ~/.ssh/known_hosts && ssh on the bottom line of the file, just below a line in a similar format for something to do with Eclipse. After rebooting, logging in didn't work. Simple as. See section 1 for more detail.

    4) How I tried (and failed) to fix it:
    I have tried fixing it using Ubuntu 14.04 which I have installed but prefer not to use due to it not being configured for my uses and not having files there and so on. Plus, 12.04 runs a bit better for some reason. Anyway, this is what I tried from within Ubuntu 14.04:
    1. Removing the line I had added to the .bashrc file - FAILED
    2. Effectively deleting .bashrc by renaming it - FAILED
    3. Accessing the files from a guest session left over from the plug intentionally being pulled while it was running and doing something with those files - FAILED
    4. Many, many reboots - FAILED
    5. See post 6 - SUCCESS! (thanks, Impavidus)


    5) Summary:
    In summary, this problem isn't urgent but I'd really like to get it sorted. The .bashrc file was edited to attempt to set a permanent alias and now everything is broken. Also, this page is really laggy with those GIFs at the side. Please fix that.
    Did I miss anything? Let's hope not. However, thanks to Impavidus everything is now fine.
    Last edited by james25; September 18th, 2014 at 04:53 PM. Reason: To say thanks to Impavidus and show that it now works.

  2. #2
    Join Date
    Aug 2011
    Location
    52.5° N 6.4° E
    Beans
    6,821
    Distro
    Xubuntu 22.04 Jammy Jellyfish

    Re: 12.04 - Crashes upon log-in

    So your graphical session crashes as soon as it starts. In 80% of the cases this is caused by either .ICEauthority or .Xauthority (hidden files in your home directory) being owned by root. This may happen due to improper usage of sudo. So to cover 90% of the cases, check your home directory for any files not owned by you. Do you have the same numeric user ID in both 14.04 and 12.04? If not, make sure all files in your 12.04 home directory (/home/james) are owned by your user ID on 12.04.

  3. #3
    Join Date
    Aug 2013
    Beans
    11

    Re: 12.04 - Crashes upon log-in

    Quote Originally Posted by Impavidus View Post
    So your graphical session crashes as soon as it starts. In 80% of the cases this is caused by either .ICEauthority or .Xauthority (hidden files in your home directory) being owned by root. This may happen due to improper usage of sudo. So to cover 90% of the cases, check your home directory for any files not owned by you. Do you have the same numeric user ID in both 14.04 and 12.04? If not, make sure all files in your 12.04 home directory (/home/james) are owned by your user ID on 12.04.
    Thanks, will bear that in mind when looking into it again tomorrow.

  4. #4
    Join Date
    Aug 2013
    Beans
    11

    Re: 12.04 - Crashes upon log-in

    Quote Originally Posted by Impavidus View Post
    So to cover 90% of the cases, check your home directory for any files not owned by you. Do you have the same numeric user ID in both 14.04 and 12.04? If not, make sure all files in your 12.04 home directory (/home/james) are owned by your user ID on 12.04.
    Yeah, one or two files are owned by root instead of myself. How do I change the user ID from root to myself? Also, should I really be changing the owner of these important-looking files such as .Xauthority and... well... that's all there is that's owned by root other than a few things that are to do with me and not the system itself. The changing of the ID is probably easy to Google but I'm still not sure about .Xauthority...

  5. #5
    Join Date
    Aug 2011
    Location
    52.5° N 6.4° E
    Beans
    6,821
    Distro
    Xubuntu 22.04 Jammy Jellyfish

    Re: 12.04 - Crashes upon log-in

    Assuming you are the first user on both 12.04 and 14.04, just mount the 12.04 partition on the 14.04 system and use (substitute some stuff)
    Code:
    sudo chown username:username /media/blah/blah/.Xauthority
    The .Xauthority file is important for some graphics related stuff when you log in to the graphical user interface. If it's not writable for the user, the graphical session crashes as soons as it starts. This usually happens because of incorrect usage of sudo.

  6. #6
    Join Date
    Aug 2013
    Beans
    11

    Re: 12.04 - Crashes upon log-in

    Quote Originally Posted by Impavidus View Post
    The .Xauthority file is important for some graphics related stuff when you log in to the graphical user interface. If it's not writable for the user, the graphical session crashes as soons as it starts. This usually happens because of incorrect usage of sudo.
    Thank you, everything is working now.

    For anyone stumbling across this forum, I ran these two commands while in my home directory on the 12.04 partition:
    Code:
    chown james:james .Xauthority
    chmod 777 .Xauthority
    The second line might not be necessary but I did it anyway just to be on the safe side and obviously "james" would have to be replaced with whatever your username is.
    Still not sure why that happened to .Xauthority in the first place though.
    Last edited by james25; September 18th, 2014 at 04:56 PM. Reason: To add that I'm still not sure why what happened happened to the ".Xauthority" file.

  7. #7
    Join Date
    Aug 2011
    Location
    52.5° N 6.4° E
    Beans
    6,821
    Distro
    Xubuntu 22.04 Jammy Jellyfish

    Re: 12.04 - Crashes upon log-in

    Setting the permissions to 777 may be on the safe side, but not on the secure side. Permissions on .Xauthority should be 600.

    .Xauthority can be written by graphical programs running in your environment. If those programs are run with root permissions, which can happen when you use sudo, .Xauthority may get owned by root. The correct way to run those graphical applications with root permissions is by changing your environment to root's. Tools like gksu or sudo -h (I think) can do so. Then they will not update your own .Xauthority, but root's.
    Last edited by Impavidus; September 18th, 2014 at 05:03 PM.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •