>>> "Jonathan Soons" <[EMAIL PROTECTED]> 11/05/2005 12:45:23 pm >>>
>I am trying to lock out a batch of users. They are all in file "cleanup.txt". >All the users exist in "/etc/shadow". I have made a backup of "/etc/shadow" to play with. >I cannot figure out why I cannot match users from the file with usernames in field 0 >of "/etc/shadow.bak". I am writing to "newshadow" to be on the safe side. >If the line: I think this is more suited to a shell command then editing the shadow file directly, since bad things can happen if you trash your shadow file. Try this: for userid in `cat cleanup.txt` do echo "locking user $userid" passwd -l $userid done This should work. The "passwd -l $userid" will lock the account for you. Jeff Eggen IT Programmer Analyst Saskatchewan Government Insurance Ph (306) 751-1795 email [EMAIL PROTECTED] ************DISCLAIMER************* This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you are not the named addressee, please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. If you are not the intended recipient you are notified that using, disclosing, copying or distributing the contents of this information is strictly prohibited. ************DISCLAIMER************* -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>