Based on /etc/shadow(5) documentation on the second (password) field: encrypted password If the password field contains some string that is not a valid result of crypt(3), for instance ! or *, the user will not be able to use a unix password to log in (but the user may log in the system by other means). My question is whether there is a linux command to disable the user password,i.e. set a "*" or a "!" on password field.
Originally asked by trikelef on Stack Exchange (unix) (CC BY-SA 4.0).