I am using Ubuntu 14.04.2 LTS, and after a power failure, I cannot login.
The computer has been working fine for a few months before this suddenly happened.

Symptoms are:

  • After an login attempt, screen blacks out for about 15 seconds, and returns to the login screen.
  • I can log in as a guest without a problem
  • I can log in as myself through tty1~tty6

I tried/checked the following with no success:

  1. Changing .Xauthority ownership didn't work
    chown username:username .Xauthority

  2. Changing the user directory rights didn't work
    sudo chmod -R u+w /home/[username]

  3. I tried meddling with lightdm
    dpkg-reconfigure lightdm

  4. sudo mv ~/.Xauthority ~/.Xauthority.backup
    sudo service lightdm restart

  5. There was nothing in .xsession-errors

  6. Tried gdm instead of lightdm, but it had the exact same issue

  7. Uninstalled lightdm and reinstalled

  8. /tmp directory does show drwxrwxrwt

None of these solutions I found on-line worked. Can anyone please help?

Edit 1):
When I typed sudo tail /var/log/lightdm/lightdm.log, there are 10 lines showing. (All starting with DEBUG:):

Activating VT 7  
Activating login1 session c3  
Session pid=8697: Greeter connected version=1.10.4  
Session pid=8697: Greeter start authentication for [username]  
Session pid=8769: Started with service 'lightdm', username [username]  
Session pid=8769: Got 1 message from PAM  
Session pid=8697: Propmpt greeter with 1 message  
User /org/freedesktop/Accounts/User 1000 changed (repeated 3 times) 

Also, when I type ls /usr/share/xsessions/, it shows

gnome.desktop    ubuntu.desktop 

Edit 2):

sudo grep 'lightdm:' /var/log/auth.log | tail gives the following, all starting with lightdm::

pam_ck_connector(lightdm:session): nox11 mode, ignoring PAM_TTY :0  
pam_unix(lighdm:session): session closed for user [username]  
PAM unable to dlopen(pam_kwallet.so): /lib/security/pam_kwallet.so: cannot open shared object file: No such file or directory  
PAM adding faulty module: pam_kwallet.so  
pam_unix(lightdm-greeter:session): session opened for user lightdm by (uid=0)
pam_ck_connector(lightdm-greeter:session): nox11 mode, ignoring PAM_TTY :0  
PAM unable to dlopen(pam_kwallet.so): /lib/security/pam_kwallet.so: cannot open shared object file: No such file or directory  
PAM adding faulty module: pam_kwallet.so  
pam_succeed_if(lightdm:auth): requirement "user ingroup nopasswdlogin" not met by user [username]"  
(this one starts with sudo: instead of lightdm:) [username] : TTY=tty1 ; PWD=/home/[username] ; USER=root ; COMMAND=/bin/grep lightdm: /var/log/auth.log  
  • Anything in the display manager log (e.g. sudo tail /var/log/lightdm/lightdm.log)? is your usual user session listed in the xsessions directory (ls /usr/share/xsessions/)? – steeldriver Feb 23 '15 at 0:05
  • Thanks - how about the auth.log? e.g. sudo grep 'lightdm:' /var/log/auth.log | tail – steeldriver Feb 23 '15 at 1:02
  • This is way beyond what I understand, but I'll tell you what I do see: Pam is some sort of security system for your computer. It is trying to do something with kwalletmanager, the program which is a password safe for KDE. But, it is trying to access what appears to be a library it uses to do so - /lib/security/pam_kwallet.so and can't find it. Check if that file exists and what its permissions are if it does (along with the directory it lives in). You might install apt-file and use it to find what package that file comes from to see if it is installed and updated correctly. apt-file update 1st – Joe Feb 27 '15 at 0:28
  • Apparently, pam_kwallet.so is something optional for Kubuntu ([bugs.launchpad.net/ubuntu/+source/lightdm/+bug/1309535]). Commenting out those optional lines removes the errors, but didn't solve the problem. I also installed Xubuntu and Xfce to see if it would work, but didn't. :( – Justin Hwang Mar 1 '15 at 19:15
  • I reinstalled Ubuntu 14.04.2 LTS (formatting the previous installation), and yet, I have the exact same issue. I'm thinking the issue is somewhere in the [user] folder? Can anybody save me, please! This is my research computer, and my dissertation research will be set back until I get this running again! :( – Justin Hwang Mar 3 '15 at 1:58

For me, the solution was simply running this command from tty1:

sudo rm .Xauthority
  • +1, This is the most common cause (wrong permissions on ~/.Xauthority). – UniversallyUniqueID Jun 10 '16 at 11:49

I know it's been a while, but in case the problem persists, her's what I'd do. This looks a lot like a "user" specific problem, especially after the reinstall.

First of all, try to create a new user (sudo adduser "username") and see if that works. If it does, you have the confirmation that something in your local configuration is wrong.

Try to start with a new, fresh configuration with the following commands (after logging in with your problematic username from a tty)

mkdir ~/cfg-backups
mv ~/.config ~/cfg-backup
mv ~/.dconf ~/cfg-backup

And check if you're back in business. You can than restore any configs from the backups that you should require.


In my case the following method solved the trouble

First login into tty by pressing CtrlAltF1.

Reinstall Ubuntu Desktop (i.e Unity)

sudo apt-get install --reinstall ubuntu-desktop

Some other tips are available here : ubuntu 14.04 login loop problem

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.