Hi Sandeep,

Assuming that you have the user names in ``/tmp/users'', something
like this would work (lines may wrap):

perl -MCPAN -e 'install Crypt::PasswdMD5'
for i in `cat /tmp/users`
do
        p=`mkpasswd`
        ep=`perl -e "use Crypt::PasswdMD5;print 
unix_md5_crypt(\"$p\",substr(time(),-8))"`
        usermod -p "$ep" $i
        echo "Password for $i is $p"
done

Save the output of the script!

Send me a pizza when it works :-)

Regards,

-- Raju

>>>>> "Sandeep" == Sandeep Singh Cheema <[EMAIL PROTECTED]> writes:

    Sandeep> hi all i want to set predetermined passwords for some 150
    Sandeep> users on my server. how can i automate the task? i heard
    Sandeep> expect can make interective scripts, but cd not get
    Sandeep> useful information on its useage.

    Sandeep> can somebody please send me useful inputs, and if some
    Sandeep> kind soul writes the script for me, it will be great...

    Sandeep> thanx and regards,

    Sandeep> sunny.

----------------------------------------------
Find out more about this and other Linux India 
mailing lists at http://lists.linux-india.org/

Reply via email to