Looking for a script to reset password

All,

I have a Solaris 9 system and I would like to create a script that would reset the password of a local user to something specific on a daily basis.

Someone suggested the following:

passwd --stdin username < passwd_file

However, this doesn't work on Solaris.

Does anyone know of a script that will acomplish the above.

Thanks

That doesn't work because passwd whats to have a real terminal in order to disable the typed characters' visibility.

i) get some type of terminal "around"
ii) code a program using e.g. PAM routines to change password
iii) write a script that directly alters the location where the password is stored (e.g. /etc/shadow , LDAP, ...)

Thanks for the response

I've now written a script that replaces the appropriate lines in /etc/shadow and it works fine.

I use expect:
#!/opt/bin/expect --

set password [lindex $argv 1]
spawn /bin/passwd [lindex $argv 0]
expect "Password:"
send "$password\r"
expect "Password:"
send "$password\r"
expect eof
set status [wait]
exit [lindex $status 3]