Scripting password changes.

Hello,

I am looking for a way to login to multiple machines and do things such as create users, reset root passwords etc non interactively.

The problem with the passwords is that all machines use ssh, dont allow root login, require to login as a normal user, su to root then change the root password. However passwd does'nt appear to take input from stdin?

Thanks

I am sure there are many similar threads from where you can get an idea.
search a bit.