Execute Bash script stored in a file over SSH
ssh root@MachineB 'bash -s' < local_script.sh
I got it from that thread: How to use SSH to run a shell script on a remote machine?
In accepted answer I see:
I'd like to have it as a one liner. Could you make a small code example?
That should be it:
ssh root@MachineB 'bash -s -- uno' < local_script.sh
or better, with a here-in document
ssh root@MachineB 'bash -s -- uno' <<\EOF
> date
> echo $1
> EOF
jue sep 18 13:01:25 CEST 2014
uno