#1
|
|||
|
|||
Script to automate passwords on multiple servers?
I'm looking to do the following but am not sure if I can do this with a SecureCRT script. Here's basically what I want to do.
First I am already logged into the Solaris 10 server via SecureCRT. I want to execute these commands FROM the server I am already logged into: 1.) Execute command - cat server_list.txt 2.) Read in the list of server names and store them. 3.) ssh first server name 4.) If this comes up on the screen "Are you sure you want to continue connecting (yes/no)?" Then send yes else continue 5.) This will display "Password: " send pop up - "Please enter your password" store password and send it to the terminal. 6.) Run command: su - 7.) Wait for "Password: " and send to screen - Please enter root password. store root password. 8.) Next run command passwd root 9.) Wait for "New Password: " 10.) send pop up with screen asking for a new root password and store it. 11.) Send new password 12.) Wait for "Re-enter new Password: " and send password again. 13.) Wait for "passwd: password successfully changed for root" 14.) send "exit" twice to logout of the server and return to next server in list and then repeat steps 4-13 until the list has expired. That's pretty much what I'm wanting to do. I have a list of about 50 servers I need to change the root password for and rather than having to do it manually I figured a script would be the easiest way to go about this. Even better would be if it presented me with a screen right up front that asked me for the variables I need and then just ran the script: so it would ask: Input YOUR Password: Current root password: NEW root password: and then run and do its thing... Any help with this would be great. Last edited by darkoth; 08-22-2008 at 09:12 AM. |
Thread Tools | |
Display Modes | Rate This Thread |
|
|