Ubuntu 13.04 Login Loop [duplicate]

Try deleting $HOME/.profile, I had the same problem before, because I added a function into $HOME/.profile.

When I deleted the function, I could login again. The original content of $HOME/.profile is

# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.

# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022

# if running bash
if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
    . "$HOME/.bashrc"
    fi
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi

The file you need to make your own again is /home/[yourUsername]/.Xauthority (the . is important!). And be sure to follow the procedure in the first solution


I had a similar problem, but neither changing the ownership of ~/.Xauthority nor commenting the content of ~/.profile made a difference. To fix it I did the following

rm ~/.Xauthority
sudo apt-get install --reinstall xorg
sudo reboot

It took a little longer than normal to login, but I was able to. My guess is that the .Xauthority file became corrupted in some way.