Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What is the easiest way to change my root password across 10 servers? 1

Status
Not open for further replies.

linuxMaestro

Instructor
Jan 12, 2004
183
US
What is the easiest way to change my root password across 10 servers?
 
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...
 
How would I create an SSH script since I 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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top