On May 1, 2011 7:24 PM, "dolphin" <yc282...@yahoo.com.sg> wrote: > > Hi, > > To reset password in unix, the system will prompt 2 times for entering > the new password. The first time is to enter the new password and the > second time is to confirm the new password of the account. It is > tedious to perform this when there is a huge volume (>100) of user > accounts. Is it possible to write a perl script that read from a file > that contain the password of the user and automate this? >
Sense the beginning of time it has been standard policy for non-root has to confirm passwd (this might be in pam now) or 'sudo passwd <user>'. To be on topic, use Unix::Password (IIRC). Either way, does your upstream provider block Google? If not, head over there and try 'cpan passwd. If you look, you might even find some full examples of what you're trying to do - its a pretty popular thing to do. If you want some fun, go download the gnu base util package and just reverse engineer passwd.c (<500 lines IIRC) > Any pointer is very much appreciated. Thanks in advance. > *pointer = Google.com Error pointer..... :)