I know this question asked so many times before but none of the solutions worked for me. My OS is Ubuntu 16.04.5 (alongside Win10) when I type the correct pw it enters the login loop.

journalctl colored output: https://gist.github.com/ridvansumset/40e9223262361fa9590aa5e5bc5e10a6

The solutions I found on the web and tried are:

1- (at login screen) Ctrl+Alt+F3 then chown username:username .Xauthority then mv .Xauthority .Xauthority.bak

2- (at login screen) Ctrl+Alt+F3 then remove lightdm and reinstall it

3- Entering the recovery mode then choosing dpkg then relogin

4- sudo apt-get purge nvidia*

5- etc/shadow file already exists.

Nothing works for me :(. Can someone please help? It's urgent

  • Also, how can I go back to login screen after entering terminal with CTRL+ALT+F3? – Rıdvan Sumset Sep 30 '18 at 14:37
  • In 16.04, press CTRL+ALT+F7 to return to the login screen (or the desktop if you are already logged in). – danzel Sep 30 '18 at 15:12

Welcome to Hell. I faced this too, and all I had to blame are unsigned Nvidia modules, or similar thing. So, I assume this isn't the first time you boot into Ubuntu since the first setup? And you got Nvidia drivers as well?

First of all, there has to be issues reported in your logs from

$ journalctl

If so, add to your post.

As a workaround, disable Secure Boot in your BIOS setup, if it's on (I mean, it MUST be on, because usually it blocks unsigned gfx driver from loading to kernel. This was my issue, however, since I left Ubuntu long time ago, I have different issue, for ex., on Arch, where desktop environment literally won't load up). Write me back with your results

  • I've been using ubuntu since may 2017. I had nvidia drivers but I used sudo apt-get purge nvidia* I don't know if I still have them. Secure boot was ON I disabled it from Windows BIOS. Then I tried to login and failed again. journalctl command's output is too big but I saw a line says secureboot: secure boot could not be determined(mode 0). – Rıdvan Sumset Sep 30 '18 at 19:53
  • I also tried to login in recovery mode but still no luck :/ – Rıdvan Sumset Sep 30 '18 at 19:57
  • bugzilla.redhat.com/show_bug.cgi?id=1451071 Also, it's obvious journalctl will output much info, but it's the system logs, it's supposed to be like that. I don't feel that the error message you shared is enough for clarifying. You could save all the error lines in some file and report back if possible like $ journalctl 2> ~/errors.txt – xt1zer Oct 1 '18 at 14:10
  • here is the colored output (if you open it in terminal) gist.github.com/ridvansumset/40e9223262361fa9590aa5e5bc5e10a6 – Rıdvan Sumset Oct 2 '18 at 9:11

OK! I figured out what my problem is and now I can login!!! Here how I solved it:

Press Ctrl+Alt+F3 to enter terminal then login with your username and password.

Firstly, run nano ~/bash_history. This will show you the commands you used before. (Notice that the command at the top of the list is the oldest one). Then, look at your commands line by line, try to figure out which one can cause this problem. Pass unimportant commands like cd or cat. Try to focus on commands that makes effect on your system or environment. If you find anything, undo what you did.

In my case, it was sudo nano etc/environment command. When I inspected that file, there wasn't even any typo. But still, I removed all the lines that I added before to revert my changes. Now it includes only $PATH variable which is: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"

Then I ran source etc/environment. After that I was able to login!

P.S: Never edit your etc/environment file. Instead use export command to set an environment variable. Besides, check if there is a typo in your ~/.profile and ~/.bash_profile files, as well.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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