Führen Sie das Shell -Skript mit SSH remote aus

ssh root@MachineB 'bash -s' < local_script.sh
Magnificent Magpie