I have upgraded Ubuntu to 12.04 and now I have a problem in logging in after locking the screen: it says the password is incorrect even though I provide the valid password. I found a temporary solution by switching users and logging in again with the same user.

  • I'd report a bug if anybody can reproduce it. If you can reproduce it, drop a comment...
    – nanofarad
    May 2, 2012 at 17:57
  • Having the same issue... on Ubuntu Mate 18.04... oddly this only occurred on my laptop after a clean install... I have installed other machines, including my desktop and there I've never had the issue... strange! I'll try the suggestion flagged as "accepted answer".
    – Manu
    Sep 10, 2018 at 20:57

4 Answers 4


I had the same issue. It is likely the ownership is wrong for /etc/shadow (See section "gnome-screensaver authentication failure with incorrect /etc/shadow permissions" of this page).

You need to sudo chown root:shadow /etc/shadow then sudo chmod u=r,g=r /etc/shadow See this bug report.

The interesting question is "Why ownership changed?". Because I don't remember changing it.

  • Thanks it worked for me! For some unknown reason, the group ownership was "root" instead of "shadow" for /etc/shadow on my laptop. Resetting the group ownership to "shadow" solved the issue :-)
    – Manu
    Sep 11, 2018 at 7:26

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

  • Albeit less informative as the answer above, this is also a correct answer, thanks! ;-)
    – Manu
    Sep 11, 2018 at 7:31

Had this problem on Ubuntu 16.04. Found the solution in http://ubuntuforums.org/showthread.php?t=1006366 (linked in fret's answer):

chmod 2755 /sbin/unix_chkpwd

In my case, unix_chkpwd had lost its setgid bit when I copied my entire filesystem to a new machine using tar.


I am using Ubuntu 14.04 and I had the same issue

By mistake I ran a chown on the root filesystem (Yikes!) and since then I started having the issue described here.

I ran the command given in oshobov's answer, but that did not work for me, but using my own account instead of root made it work.

sudo chown your-username:shadow /etc/shadow
  • 2
    /etc/shadow must not be owned by any other account than root!
    – guntbert
    Oct 5, 2014 at 16:33

You must log in to answer this question.

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