The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 06-30-2009
ulemsee ulemsee is offline
Registered User
  
 

Join Date: Apr 2009
Posts: 6
Multiple ssh, shutdown and exit script

PROBLEM:

I need to ssh into multiple remote machines, send a shutdown command and exit. The remote servers will then run their own scripts to gracefully shutdown their applications before shutting down.

ONE: This is to be achieved without using public key authentication; this is being avoided as a security measure. (Not negotiable) :-)

TWO: Passwords are required.

SO FAR:
I wrote an expect script that ssh's into the remote server, and calls on a script. Trouble is the expect script on the "master" server waits for the remote script to complete before exiting,thus time is wasted (I am trying to shut down several servers within a certain time).

Is there a way to run multiple instances of my expect script simultaneously, or /and is there another way to do this. If sequentially, then in the shortest time possible.


Thanks!!!