On 21-Jan-02 brettp@users.sourceforge.net wrote:
On Mon, Jan 21, 2002 at 12:03:55PM +0000, 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 ???
have you got a list of usernames in a file? if so, you could do something similar to:
$ for user in `cat usernames`; do usermod -p $user $user; done
That should do it for you. Thanks, Brett Parker
Not sure this will help, since it looks as though the password argument to usermod -p has to be already encrypted:
usermod [-c comment] [-d home_dir [ -m]] [-e expire_date] [-f inactive_time] [-g initial_group] [-G group[,...]] [-l login_name] [-p passwd] [-s shell] [-u uid [ -o]] [-L|-U] login
-p passwd The encrypted password, as returned by crypt(3).
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:34:13 ------------------------------ XFMail ------------------------------