Execute the same command on multiple Linux host in once

I found difficult to maintain updates over multiple hosts however, some tool exist to facilitate that time of maintenance steps.

Alternatively, some python script could also be used however I have decided to present that one for now.


On Centos/Redhat:

yum install python-pip

On Debian based:

apt-get install python-pip

prepare your list of hostsĀ  IP with the port (SSH is 22) which you require to run the same command, and run this as example:

Then you can run this as command:

pssh -h hosts -l pi -A -i "sudo uptime"

Leave a Reply