Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Re: Lock Account

From: Brian Hatch <secure-shell(at)ifokr.org>
Date: Fri Feb 21 2003 - 14:12:46 EST

> > If you want to disable a user temporaly you can add an asterisk (*) before
...
>
> ... this is a very dangerous MYTH. It does not disable the account (there is
...

However if you prepend with "-" that will disable the account on many unix variants by abusing an NIS trick. (You dictate which NIS accounts or groups to not include by using -name entries.)

Try it out:

$ tail -1 /etc/passwd
badguy:x:1000:1000:Some bad user:/home/badguy:/bin/sh

$ perl -e 'while (($username)=getpwent()) { print " $username\n"; }' | grep badguy badguy

# vi /etc/passwd
 (prepend '-')

Do you need help?X

$ tail -1 /etc/passwd
-badguy:x:1000:1000:Some bad user:/home/badguy:/bin/sh

$ perl -e 'while (($username)=getpwent()) { print " $username\n"; }' | grep badguy $

> Depending on the password management system on your system, there are

Still doesn't work if the user has alternate authentication methods, such as SSH identities, which do not require valid /etc/shadow entries. Better to remove the whole account by editing /etc/passwd.

--
Brian Hatch                  Ever wonder what the
   Systems and                speed of lightning
   Security Engineer          would be if it
www.hackinglinuxexposed.com   didn't zigzag?

Every message PGP signed

  • application/pgp-signature attachment: stored
Received on Fri Feb 21 14:50:24 2003

This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 14:02:54 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library