On 21-Jan-02 Simon wrote:
Hi, does anyone know of, or can help me. I need a script/prog to change about 3500 users passwords to their usernames ???
Please!!???
Simon
Hi Simon, Probably the program 'chpasswd' will do what you want. It should be available on any Linux system:
"man chpasswd" chpasswd - update password file in batch
SYNOPSIS chpasswd
DESCRIPTION chpasswd reads a file of user name and cleartext password pairs from standard input and uses this information to update a group of existing users. Each line is of the format
user_name:password
The named user must exist. The supplied password will be encrypted and the password age updated, if present.
This command is intended to be used in a large system environment where many accounts are created at a single time.
So, in your case, if you prepare a file "usr_pwd" in the form
user_name:user_name ....
you should then (as root) be able to do
chpasswd < usr_pwd
You may need to watch out whether the system dislikes short simple passwords (which usernames might be). I don't know whether this might fail on such cases.
You might also look at "man newusers".
Hope this helps! Ted.
-------------------------------------------------------------------- E-Mail: (Ted Harding) Ted.Harding@nessie.mcc.ac.uk Fax-to-email: +44 (0)870 167 1972 Date: 21-Jan-02 Time: 12:20:04 ------------------------------ XFMail ------------------------------