Auto SSH and execute script

Posted by rohanbk on Stack Overflow See other posts from Stack Overflow or by rohanbk
Published on 2010-04-01T13:51:23Z Indexed on 2010/04/01 13:53 UTC
Read the original article Hit count: 255

Filed under:
|
|

I have roughly 12 computers that each have the same script on them. This script merely pings all the other machines, and prints out whether the machine is "reachable" or "unreachable". However, it is inefficient to login to each machine manually using ssh to execute this script.

Suppose I'm logged into node 1. Is there any way to for me to login to node 2-12 automatically using SSH, execute the ping script, pipe the results to a file, logout and proceed to the next machine? Some kind of bash shell script?

I'm afraid I'm at a loss here since I haven't had experience with shell-scripting before.

© Stack Overflow or respective owner

Related posts about scripting

Related posts about bash