Re: Different ways of locking accounts
- From: "Wei Chen" <wchenhk@xxxxxxxxx>
- Date: Sun, 18 Mar 2007 00:44:18 +0800
On 3/18/07, Roberto C. Sanchez <roberto@xxxxxxxxxxxx> wrote:
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.
Will there be problem if I lock an account with one program and unlock with
another?
BTW, both methods lock shells as well as ftp and sftp. Changing the shell to
/usr/sbin/nologin allows ftp but still prevents sftp.
Is there a method that locks shell but allows ftp and sftp? Thanks.
Regards,
-Roberto
--
Roberto C. Sanchez
http://people.connexer.com/~roberto<http://people.connexer.com/%7Eroberto>
http://www.connexer.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
iD8DBQFF/Bct5SXWIKfIlGQRAsB0AKCLs/uoTxkHSpX6M5SXQSUD4I+TAQCgvv+L
Eu1fAsocFvDZQD5EYnR2M/w=
=NBbi
-----END PGP SIGNATURE-----
--
Cheers,
Wei
http://www.acplex.com/people/wchen/
- Follow-Ups:
- Re: Different ways of locking accounts
- From: Roberto C. Sanchez
- Re: Different ways of locking accounts
- References:
- Different ways of locking accounts
- From: Wei Chen
- Re: Different ways of locking accounts
- From: Roberto C. Sanchez
- Different ways of locking accounts
- Prev by Date: Re: tar vs
- Next by Date: Re: Different ways of locking accounts
- Previous by thread: Re: Different ways of locking accounts
- Next by thread: Re: Different ways of locking accounts
- Index(es):
Relevant Pages
|