Bulk passwd change using a "here" script

From: SMITH, Carl, IT-NWS (Carl.Smith@natwest.com)
Date: Fri Sep 20 2002 - 05:04:00 EDT


All,

I am regularly going to have to reset 150 user's passwords and set them to a
chosen default password, then forces them to change it. I have set up a
here script to do this, but the script does not enter the password into the
password prompt and instead waits for you to type in a password, I have
tried numerous different methods but without success. The script is very
basic, I can't believe there is an issue with it: -

#!/bin/ksh
#
## Variables
USERLIST=/var/tmp/userlist.txt

## Main
for USER in `cat $USERLIST`
do
passwd $USER << EOF
defaultpw
defaultpw
passwd -f $USER
EOF
done

TIA,

Carl

Carl Smith
UNIX System Administrator
UNIX Support (NWS)
Coutts Group IT
carl.smith@natwest.com

Issued by NatWest Stockbrokers Limited, a member of the London Stock
Exchange and regulated by the FSA.
Registered Office : 55 Mansell Street, London E1 8AN. Registered number
1959479 England

National Westminster Bank Plc ("the Bank") is a member of the NatWest and
Gartmore Marketing Group. The only packaged products (life policies, unit
trusts and other collective investment schemes and stakeholder and other
pensions) the Bank advises on and sells are those of the Marketing Group,
whose members are regulated by the Financial Services Authority. NatWest
Stockbrokers Limited is also a Member of the London Stock Exchange.

National Westminster Bank Plc. Registered in England No 929027. Registered
Office: 135 Bishopsgate, London EC2M 3UR. National Westminster Bank Plc is
a member of The Royal Bank of Scotland Group.

Agency agreements exist between members of The Royal Bank of Scotland Group.

This e-mail message is confidential and for use by the addressee only. If
the message is received by anyone other than the addressee, please return
the message to the sender by replying to it and then delete the message from
your computer. Internet e-mails are not necessarily secure. National
Westminster Bank Plc does not accept responsibility for changes made to this
message after it was sent.

Whilst all reasonable care has been taken to avoid the transmission of
viruses, it is the responsibility of the recipient to ensure that the onward
transmission, opening or use of this message and any attachments will not
adversely affect its systems or data. No responsibility is accepted by The
Royal Bank of Scotland plc in this regard and the recipient should carry out
such virus and other checks as it considers appropriate.
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:24:58 EDT