How to poweroff multiple linux machines in a single command or script?

I have more than 10 Linux machines. How may I power off all machines using a single script?

The password and user is the same for all of the machines.


There’s many mays to do it.

One option is to use ssh key pairs instead of passwords to ssh without prompting for password. Then, you can do this :


for server; do ssh $server 'halt; exit'; done


./script.bash server1 server2

Or you can use a better approach with a tool like or pssh

Leave a Reply

Your email address will not be published. Required fields are marked *