1

Someone told me that it's possible to group machines you want to shutdown together, and that you can turn them off using the standard shutdown command in bash.

How would one go about setting this up?

0

Assuming you have ssh access set up on all computers in question something like

while read host; do
    ssh "root@$host" shutdown -h now &
done < host-list 

should work. If you need it configurable just put the host list into a config-like file.

  • This is obviously assuming root login over SSH is not prohibited, and that public SSH keys have been distributed to the root accounts on all hosts for the local user. – Kusalananda Jul 14 '18 at 12:14
  • @kusalananda Yes :-) Can be done with another user account and sudo as well of course. But any attempt to remotely shutdown a system will require a local login of some kind. – nohillside Jul 14 '18 at 12:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.