# passwd -l user
Locks user‘s account, that is, prevents user from logging in.
Note: This option is available in Linux and Solaris. In Mac OS X, -l option means something different:
# passwd -l location user
Here, -l changes the password in location. Valid values are:
file: a filename. Default is/etc/master.passwdnetinfo: a domain name or server/tag pairnis: an NIS domain nameopendirectory: a directory node name
Not always.
Some variants of passwd may not have this flag, others may mean something else. Better to man passwd (command not file or database) to see what is available. Better yet, just edit the passwd file to lock out users.
You are right cservant. the
-loption is only available for Solaris and Linux. I use to tag the post with the OS that allow the command and the option, but this time I forgot it. I am updating the post. Thanks :)[...] user’s account. That is, lets user log in (a locked account is one prevented from logging in). Tagged: linux, passwd, [...]