Welcome to the VanDyke Software Forums

Join the discussion today!

Go Back   VanDyke Software Forums > Scripting


Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
Old 08-22-2008, 09:08 AM
darkoth darkoth is offline
Registered User
Join Date: Jun 2007
Posts: 29
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.
Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -6. The time now is 08:08 PM.