I locked the passwd for a user by using the command,

sudo passwd -l [user]

Then, how do I unlock the passwd for this user?

  • 1
    Usually, you can consult the man page for a command in these situations. In your case, you could have typed man passwd, then type /unlock and hit Enter in order to search for the word unlock in the man page. This leads directly to the option -u. – Stefan Hamcke Feb 3 '18 at 17:54
sudo passwd -u [username]

from man passwd:

-u, --unlock Unlock the password of the named account. This option re-enables a password by changing the password back to its previous value (to the value before using the -l option).

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.