On Sun, Mar 18, 2007 at 12:18:55AM +0800, Wei Chen wrote:
> Hi,
>
> I recently found ways that can lock user accounts on the local machine,
> including "passwd -l" and "usermod -L".
>
> I am wondering now what is the difference between the two commands and which
> one is preferred (or standard, or more widely used). Thanks.
passwd(1):
User accounts may be locked and unlocked with the -l and -u flags. The
-l option disables an account by changing the password to a value which
matches no possible encrypted value. The -u option re-enables an
account by changing the password back to its previous value.
usermod(1):
-L Lock a user's password. This puts a '!' in front of the
encrypted password, effectively disabling the password. You
can't use this option with -p or -U.
They more than likely do the same exact thing, if for no other reason than
for compatibility. Either way, they both lock an account by making the
hashed password value one that connot match any possible hash.
Regards,
-Roberto
--
Roberto C. Sanchez
http://people.connexer.com/~roberto
http://www.connexer.com
Attachment:
signature.asc
Description: Digital signature