I had to reinstall recently. I installed normal Ubuntu 14.04. I then installed gnome/gnome shell/gdm. I then logged in my user to gnome. Since then I have been configuring my system.

Yesterday, unlock was working fine. Today, the automatic lock screen is not accepting my password as valid. It just takes the input like it's processing it, then takes me right back to the same password prompt. If I click the 'login as a new user' link, it takes me right back to the lock screen. Ctrl+Alt+F1, etc, does nothing.

I had to resort to a hard boot. I've tried this more then once. (first time was from automatic, idle time lock, second time was from my triggering the lock screen with the keyboard command).

I'm certain I have my password right, as I am able to get logged in after the cold boot.

  • Check your permissions on ~/.Xauthority sounds like root owns it now. You can simply delete it and you should be fine. One reason why you don't use sudo to open GUIs Aug 11, 2014 at 15:30
  • @ElefantPhace You might want to post that (or something like it) as an answer. Aug 11, 2014 at 15:33
  • I will add just a little bit. Since I asked this question originally, I still have this problem happen on a regular basis. Usually about once a month. I have noticed, that for some reason, the most often (NOT EVERYTIME), this seems to happen on days where I've found myself booting more then once. I can not see how that would related to anything, but it's the only other piece of evidence I've gathered so far. Mar 6, 2015 at 23:43
  • It is possible your keyboard layout was reset to a different language. For example changing from UK to US would have the result of some of the non-alphanumeric characters not printing what you think they are.
    – ALX
    Feb 4, 2022 at 9:36

7 Answers 7


Neither of the other two answers solved the problem for me, but some additional searching led to this bug report:

sudo chown root:shadow /sbin/unix_chkpwd
sudo chmod 2755 /sbin/unix_chkpwd

which solved the issue for me.

  • Solved my problem too on Ubuntu 16.04.
    – X09
    Mar 9, 2017 at 13:36
  • 1
    Worked for me ubuntu 16.04 LTS
    – Nimish
    Sep 8, 2018 at 21:50
  • these are already the permissions that ubuntu comes with ootb
    – ccpizza
    Sep 29, 2019 at 7:29
  • @ccpizza And? That doesn't mean they can't get corrupted or changed. Sep 29, 2019 at 14:16
  • 1
    This (or fret's solution below) helped on 18.04.
    – WoJ
    Apr 8, 2021 at 16:11

I could resolve this issue with the following permission changes:

sudo chown root:shadow /etc/gshadow
sudo chown root:shadow /etc/gshadow-
sudo chown root:shadow /etc/shadow
sudo chown root:shadow /etc/shadow-

Found here: http://ubuntuforums.org/showthread.php?t=1006366

Check also this question: Lock screen - password incorrect

  • 2
    This (or Nick's solution above) helped on 18.04.
    – WoJ
    Apr 8, 2021 at 16:11

Open a terminal and type ll | grep '.Xauthority' and make sure it is owned by you and not root.

You can chown it or just remove it, it'll come back! Now just log out and log back in.

This is one of the main reasons why you shouldn't use sudo to open GUIs, as root will take ownership of some of your files in your home directory.

  • the .Xauthority file is owned by my user. So, as much as I would love a simple fix like this. It is unfortunately not my problem. Aug 11, 2014 at 15:44
  • Check your .xsession-errors and see if you can find any clues there Aug 11, 2014 at 15:48
  • No .xsession-errors file, but I haven't locked my screen since the most recent reboot. And if I did, I wouldn't be able to get back in, until I rebooted. So, if it's a file that persists across reboot/relogins/restarting x, then it's not present. Aug 11, 2014 at 15:53

I had a similar issue after upgrading to 20.04. If I suspended the computer and tried to log back in I could not enter my password at the login screen.

I was able to fix this by purging and then reinstall lightdm the issue was solved.


sudo apt purge lightdm
sudo apt install lightdm

I had an issue like this, my password was not getting accepted from the GUI login page. Then I logged through the recovery mode and did following:

su # followed by root password
mount -o remount,rw /  
mv .bashrc bashrc_old
mv .profile profile_old

Now logging in with password will work again.


I faced the same problem. As I found out, it was caused by setting the DISPLAY variable in my user's .bashrc (and .profile) to 'localhost:0.0'. After commenting this definition out, I was able to log in to GUI. Otherwise, only terminal login (ctrl-alt-F1 or ssh) was possible.


Neither of the 5 answers solved my problem, but this did on Ubuntu 18.04:

I remembered what language/keyboard layout I have used last before letting the screen locked, then I entered my password in that language, despite what language was shown in the lock-screen app.

There is a bug in the lock-screen app which doesn't change the keyboard layout despite it shows it was changed.

  • How can you enter your password regardless of what lock screen is showing off? How do you change your language on lock screen then? Nov 30, 2019 at 12:57
  • @SergeyBushmanov Just pretend you've another layout than what is shown and type your password. You can't change the layout from what was set when you locked the screen despite what it is shown. That's why the bug is reported.
    – 1mi
    Dec 2, 2019 at 15:22
  • Whatever I pretend none of the passwords is accepted. Dec 2, 2019 at 15:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .