There are many ways to run some commands simultaneously on multiple
hosts like cssh or dsh. They come handy for example when you are
installing software updates on a set of hosts.
dsh is a rather simple comandline tool allowing to execute a command
over ssh on multiple hosts. However it doesn't allow any interactive
input -- so you can't look at the potentially upgrading packages and
press y to accept and you can't go through debconf promts or
similar.
This is solved by cssh which opens a XTerm for every host and a
input area that is broadcastet to all of them. this is working really
well -- you can execute your update on all hosts and still do
individual adjustments just as needed: switch focus from the
broadcasted input to one of the terminal windows and anything you type
just goes there.
Now cssh has a big disadvantage: it requires a running X server (and
doesn't do too well with a fullscreen windowmanager). Requiring X is
quite a blocker if you need to run that ssh multiplexer on a remote
host, for example if the firewalling doesn't allow direct
connections. Fortunately you can make tmux behave as we want -- in a
simple terminal:
First you need a script spawning the ssh sessions in separate tmux
panes and direct input to all of them -- here called
ssh-everywhere.sh (you could also write a tmux config I guess):
#/bin/sh
# ssh-everywhere.sh
for i in $HOSTS
do
tmux splitw "ssh $i"
tmux select-layout tiled
done
tmux set-window-option synchronize-panes on
Now start the whole thing:
tmux new 'exec sh ssh-everywhere.sh'
And be done.
Update
If you want to type in just one pane (on one host) you can do that as well: C-b : set-window-option synchronize-panes off
and moving to the right pane (C-b + Arrow keys)
-- Christoph Egger <christoph@coders-nemesis.eu> Sun, 20 Feb 2011 17:23:04 +0100
Comments:
Hallo, ich Ihre Arbeit apreciated auf dieser Website , sind Sie mit großem Wissen beitragen ! Dieser Blog ist sehr interessant!
Mein Name ist Andreia , von Paris , also werde ich ein Anhänger von dieser Website zu sein , kann meine persönlichen Daten nicht im besten Interesse aller sein, aber ich sage ihnen aus der Bahn Ich mag Bücher sowie TV-Shows, und ich spielen auch viel Rhiana auf meinem Parteien , ich bin jetzt so ohne Freund männliche Nutzer nur ein Scherz .... :)! Ich habe bereits versucht Online-Dating- es hat nicht sehr gut funktioniert ....
Ich schrieb diesen Kommentar , weil wie gesagt ich vorher wirklich genießen Sie diese Seite habe ich auch eine Platte genau wie Sie, aber mir ist viel anders verkaufen , es geht um gratis Poker Geld .... :)
Ich werde auch noch dafür entschuldigen, meine Sprache ist der einzige Weg erhalte ich mit dir zu reden ist ....
bleiben auch bei allen bedanken , Bye bye
-- Apuestas Gratis <andreafoxzzz@gmail.com> Thu, 26 Apr 2012 14:00:00 +0200