14

It is possible to lock a password using

$ passwd -l john

But what does that actually mean to lock a password?

1 Answer 1

19

man page for passwd:

-l, --lock Lock the password of the named account. This option disables a password by changing it to a value which matches no possible encrypted value (it adds a ´!´ at the beginning of the password).

Note that this does not disable the account. The user may still be able to login using another authentication token (e.g. an SSH key). To disable the account, administrators should use usermod --expiredate 1 (this set the account's expire date to Jan 2, 1970). Users with a locked password are not allowed to change their password.

1
  • 5
    I didn't know man had so much more info. I just used passwd --help Dec 2, 2017 at 22:48

You must log in to answer this question.

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