A very useful tool in cluster environment

Distributed Shell (dsh) is a very powerful tool for system administrators in a cluster environment. Here are some tips for installing and using it:

sudo apt-get install dsh


sudo yum install dsh

In /etc/dsh/dsh.conf change remoteshell:

remoteshell =ssh

Here is how to make your public key if you do not have one yet (~/.ssh/id_rsa.pub)

$ ssh-keygen -t rsa -P “”
(no passphrase , ~/.ssh/id_rsa.pub will be created )
$ ssh-copy-id -i ~/.ssh/id_rsa.pub   ALL_OTHER_HOSTS

Then in /etc/dsh/machines.list  put all your hosts:


Finally you can issue commands to ALL the hosts in your cluster:

$ dsh –aM –c YOUR_COMMAND

For example:
$ dsh –aM –c uptime