Quote:> recently changed 30 -40 machines root passwords.
> All these machines have the same root passwords.
> They're all on a network.
> They all have almost identical loads in terms of code level etc.
> Surely there must be a way to automate with using a script?
Look into doing two things.
1) Install SSH2 so that the passwords (especially root passwords) are not
passed in cleartext across the network
2) Get Expect!
Expect is a software suite for automating interactive tools. It is based
on Tcl and it allows you to build a script which handles interactive tasks
(tasks which provide a prompt and expect a response from a keyboard). There
are even sample programs written by Don Libes such at "passmass" which is
the basic framework for what you want to do. Expect is freely available and
it isn't too tough to modify the example programs in a short time to get
If you can write scripts, you can understand the expect stuff. I would
recoomend getting your hands on the O'Reilly book "Exploring Expect" as it
fills in the gaps.
SSH2 is availbe for a fee from F-Secure www.F-Secure.com and it is the part
that encrypts your sessions between remote hosts.
I did pretty much the same thing you are describing and it took me about
three days of tinkering to come up with a workable solution. The biggest
deal with expect is knowing what sort of prompts you will get for a given
action. Also be aware that you need to know what a standard command line
prompt is going to be, so if you muck with the "PS1" prompt, you have to
take that into account. You can also use expect and SSH2 to allow your users
to set their passwords on multiple hosts via a single script. Of course it
will be much easier to do if their "PS1" prompts are all pretty much the