Hi All
I need to automate (execute from a script or loop on the command line) password changes on a number of UNIX boxes. I cannot use telnet since I have disabled this on all servers - and installed SSH.
I have root private/public keys setup so that I can login directly into the boxes non-interactively, hence I am looking for something like this:
ssh $hostname "/path/to/a/local/script"
Obviously that script can take username and password variables from a access restricted file on each host, or even specify these in the script itself. What I plan on doing is pushing the same script out to all servers and then executing it.
The problem is, as we all know, passwd is interactive, and I just cannot get it to read from stdin. I have tried:
passwd $username<<EOF
password
password
EOF
But this does not work.
The reason I need to use passwd is because the boxes are installed with a variety of UNIXes, so I need something that will work universally, and not something that relies upon OS specific tools.
Any ideas? Or anyone have any better ways to do this ( bearing in mind the solution must be cross-platform friendly).
webmin has a cluster change password module standard with version 1.170 but you need to have webmin installed on all machines and configured in a cluster, meaning all listening on port 10000 and tell webmin it's in a cluster. if you have webmin running in a cluster you can execute some commands from a central location like change passwords, copy files, cron jobs, shell commands, users and groups, install software and webmin configuration. maybe some third party modules have extra functionality. check out the webmin site in their standard modules.