My computer wont allow me to login unless its as guest. I have pressed Ctrl+Alt+F1 and can login using my administrator account there, but not in the normal interface. I have done updates and upgrades from the terminal, and also tried to create a new admin user, and assigned the user to the same group as the administrator account, but cant login to that user either from the normal login screen.

When I login the screen flashes black and then returns to the login screen Is there a way to view an error log file to see what the error is that is returning me to the login screen? How can I do this to figure out what the problem is?

I have also followed instructions on this page Ubuntu gets stuck in a login loop.

It looks like a similar problem, but the fix did not work for me :(

I would like to get back into my admin account and my programs but I am stuck in guest

  • 1
    Have you followed the answer correctly? If you followed the answer, please include the exact commands you have given and the output (if any). Imp. point - chown username:username .Xauthority in this cocmmand you need to replace username with your administrative account name (case sensitive)
    – Web-E
    Aug 12, 2013 at 19:15
  • My username is Administrator on the pc, there was only an administrator user and a guest option.
    – Francois
    Aug 13, 2013 at 8:20
  • I did the command: chown administrator:administrator .Xauthority and it just goes to the next line. If I look at the list of files it does say that the file is administrator, administrator, 0 bytes and -rw--------. When I did ls -ld /tmp I see that it does look like this drwxrwxrwt 15 root root 4096 Nov 30 04:17 /tmp. Should that not also be administrator administrator? I also did dpkg-reconfigure lightdm and that just goes to the next line, so I cant see if anything happens.
    – Francois
    Aug 13, 2013 at 8:27
  • Is there a way to see a log file of what is going wrong when it tries to login? Surely then I will be able to see what is failing and maybe fix that?
    – Francois
    Aug 13, 2013 at 8:28
  • You may wish to check your /etc/login.defs and /etc/adduser.conf files if you have changed your uid outside of the limits provided in those configuration files. See this answer
    – K Markey
    Mar 20, 2018 at 22:15

2 Answers 2


I had the same problem. It seems there was some kind of problem in my ~/.profile file. Rename it to something else (so you don't loose it) and try logging in again.

This solved my problem.

  • 1
    This actually helped me, probably a typo in my profile and rendered my linux box unused. Have tried other fixes but this simple one made the trick
    – roy riojas
    Feb 26, 2014 at 1:13

for me, I had mistakenly overwritten my PATH in /etc/environment. I had done something like:



So, once I got to a terminal (ctrl + alt + F1), and tried to, e.g., 'cat', I was getting:

The command could not be located because '/bin' is not included in the PATH environment variable. echoing the PATH showed me that I had overwritten my PATH, so I had to manually set PATH:


Then I could use vim (or whatever) to manually edit my /etc/environment back into a good state.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.