Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
I'd report a bug if anybody can reproduce it. If you can reproduce it, drop a comment... – hexafraction May 2 '12 at 17:57
up vote 6 down vote accepted

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.

share|improve this answer

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:

share|improve this answer

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
share|improve this answer
/etc/shadow must not be owned by any other account than root! – guntbert Oct 5 '14 at 16:33

protected by Community Dec 24 '14 at 13:57

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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