Did you know you can just send a command and receive its output with ssh?
ssh [email protected] 'uptime'
you can also script for multiple commands do:
ssh a[email protected] << EOF COMMAND1 COMMAND2 COMMAND3 EOF
so simple right? it also supports running a script.
ssh [email protected] 'bash -s' < myscript.sh
Use this now to your deployment or automation tasks! 😀