Article submitted by Maurizio Pedraglio. We are running out of articles! Please help DPOTD and submit good articles about software you like!
Clusterssh is a graphical utility that allows you to open several ssh connections and execute commands simultaneously in all of them. I find it powerful in many cases, for example when I’ve to perform a dist-upgrade on many different servers.
It provides a small window to control the sessions, and one xterm window for each one of them. Here are some screen shots using it on Ubuntu and Gnome 2.20.
You can open a ssh session simply clicking on “Host” and then “Add Host”.
Type user@server in the “Add Host” window and a new shell will appear in a new window.
You’ll be able to open n different ssh session versus n hosts. You should focus the input box in the controlling window to send commands to all the shells at once.
If you want to execute a command only in a single host, simply focus the right shell. The other shells won’t receive anything, and the command will take effect only on the selected host.
If you want to detach a shell from the parallel command execution, simple uncheck it in the “Host” menu. In the case below commands will be executed on host 192.168.15.104 and localhost1 but not on localhost
Others commands available: use “Toggle active state“ to uncheck all host; “Retile” allows you to reorganise windows in the desktop. Clusterssh can also be launched from the command line, just type in a shell:
cssh serverA serverB … serverN
Clusterssh has been available both in Debian and Ubuntu since a long time ago