Why not the following (done from the command line here quite often):

for I in linux01 linux02 linux3 linux4 ; do ssh $I 'ls /root' ; done

If you have a lot of penguins swimming around, put the names in a file, one
per line and do it this way:

for I in `cat penguins.list` ; do ssh $I 'ls /root' ; done

Of course, you could easily script this and generalize it to accept whatever
command you wanted from the command line. The for loop is easy enough,
though, that I haven't felt a compelling urge to do so.

--
   .~.    Robert P. Nix             Mayo Foundation
   /V\    RO-OE-5-55                200 First Street SW
  /( )\   507-284-0844              Rochester, MN 55905
  ^^-^^   -----
        "In theory, theory and practice are the same, but
         in practice, theory and practice are different."




On 7/12/07 10:44 AM, "Michael MacIsaac" <[EMAIL PROTECTED]> wrote:

> Hello list,
>
> Does anyone have a simple wrapper around SSH to run the same command on
> multiple Linuxes?
>
> If I have key-based authentication set up from one server to another
> server, call it "linux01", I can issue the command:
>   # ssh linux01 ls /root
>   bin
> and see the output from linux01 without needing a password.
>
> But let's say I'd like to issue that command on 5 different linuxes.  I
> could call the command dssh and define a group "linuxes" that consist of
> linux01-linux05.  Then I could issue the command:
>   # dssh linuxes ls /root
>   linux01:
>   bin
>   linux02:
>   bin
>   linux03:
>   bin
>   linux04:
>   bin
>   linux05:
>   bin
> and see the output from each member in the group.
>
> I thought about cobbling together a script, but certainly this has been
> written.  Maybe there's already an RPM in my distro that just has to be
> installed.
>
> Thanks.
>
> "Mike MacIsaac" <[EMAIL PROTECTED]>   (845) 433-7061
>
> ----------------------------------------------------------------------
> For LINUX-390 subscribe / signoff / archive access instructions,
> send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit
> http://www.marist.edu/htbin/wlvindex?LINUX-390

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390

Reply via email to