Administering multiple ssh shells simultaneously with cssh

14 Jun 2013 in TIL

cssh is a tool that lets you administer multiple ssh sessions at the same time. Whilst it's not advised for production use, it's a huge timesaver for some common tasks.

The best way to understand what it does it to watch the following video. Although it's recorded on Windows, it works just the same on Linux/OSX.

If you want to install it, you need the clusterssh package.

On Debian:

bash
sudo apt-get install clusterssh

On Redhat:

bash
sudo yum install clusterssh

As well as providing muliple hosts, you can use shell expansion to connect to lots of machines at once:

bash
cssh michaeldev-{01..10}

Once all the windows appear, put your mouse over the grey box and start typing. Your characters should appear in every SSH window that cssh opened. It also supports sending control characters (e.g. ctrl+L to clear the screen) and pasting from the system's clipboard