I have a laptop with Ubuntu 14.04, when I lock my computer and try to unlock it after some time has passed (not if I do it immediately) the first time I try to unlock it, it will tell me that my password is wrong. When I enter my password a second time it unlocks as it should.

The first few times I though that I just typed my password wrong, but since then I've tried to type it very slowly and carefully. So I am 100% sure that the password I enter is correct.

I've also checked if the first key isn't recognized, but even pressing space a few times and deleting every character after that has the same result.

Any idea why?

  • Is some kind of screensaver active when the error happens?
    – Jan
    Sep 1 '14 at 9:59
  • @Jan: No, my screens are just in standby.
    – Feroc
    Sep 1 '14 at 10:50
  • Sounds like a fun bug.
    – Kaz Wolfe
    Oct 1 '14 at 17:09
  • Try to enter the password after a delay say after 10 seconds.
    – totti
    Oct 5 '14 at 6:49
  • @LonelyKing - Nope, see description.
    – Feroc
    Oct 5 '14 at 12:57

It happens because when you press the first key of your password the computer comes out of screen saver/sleep mode if it has been lying unused for sometime. So the first key press actually works kind of awakening the pc. And your second key actually gets typed in as first key. This also happens to me on Windows platform as well. So what I suggest is press space key or some other key (space is better because it is less confusing) and when password box appears start typing. PS:- Sometime you might need to press power key of your laptop to bring it out of sleep mode.

  • 2
    Just verified, this is not the case on 12.04. The first keypress deactivates the screensaver AND gets recognized as the first letter of the password.
    – Jan
    Sep 1 '14 at 10:51
  • hmm... I will give it a try the next time. But I am pretty sure that I typed so slowly and looked so carefully, that I saw the first letter appearing as a star in the box. Especially as I usually shake my mouse to wake up the screens.
    – Feroc
    Sep 1 '14 at 10:53
  • 4
    I recommend tapping the Shift or Control keys to wake the machine back up. They wont be entering any characters into a field.
    – Richard
    Sep 1 '14 at 10:55
  • 1
    Nope, I watched very carefully this morning. Pressed space a few times and deleted all the stars. My first password still was wrong.
    – Feroc
    Sep 2 '14 at 5:33
  • 1
    I have this problem, and your answer is not what's happening. I don't even press a key to wake from suspend - my computer wakes by pressing the power button once. The first key also clearly shows one masked password character.
    – Dronz
    Apr 19 '17 at 8:05

One thing I have seen before is that the first key you press sometimes is not actually captured. Try dropping in a couple of spaces then erase them all.

Try typing in your password after that and see if it works.


Go to the path file: sudo nano /etc/pam.d/common-auth and modify the below line

auth    [success=1 default=ignore]      pam_unix.so nullok_secure try_first_pass

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.