As I was trying to automate my unit testing I run into this requirement, the general syntax to execute a command remotely is:
ssh -t [email protected] command
So for example if I wanted to execute my_script.sh on my home folder I could do:
ssh -t [email protected] /home/my_user/my_script.sh