Due to the security associated with root, I'm not sure there is a better or faster way than using the passwd command from SSH or however you connect to them. You could create an SSH script for next time if you always make all the root passwords the same...
Well, back in the day, I use to have some Unix boxes with telnet, which is basically unencrypted ssh, that I'd do a script like this with:
Code:
telnet box2 < telnetcommands.txt
With telnetcommands.txt contents the telnet commands I wanted to use. (You can use command line parameters %1 and %2 to specify the old password and the new one.) Reading up on ssh though, looks like a lot of people have had trouble with this route. I don't have access to a box to try it right now, but it shouldn't take long to see if you get stuck at password like I'm hearing.
The solutions Google has suggested are to use ssl keys without passwords or, my favorite, "expect" which can deal with interactive commands like SSH better than bash by itself.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.