ssh(1) user@host sh < your_script.sh
OpenSSH SSH client (remote login program)
ssh connects and logs into the specified hostname (with optional user name).  The user must prove his/her
identity to the remote machine using one of several methods depending on the protocol version used (see
below).

If command is specified, it is executed on the remote host instead of a login shell.
Before a command is executed, its input and output may be redirected using a special notation interpreted
by  the  shell.   Redirection  may  also  be used to open and close files for the current shell execution
environment.  The following redirection operators may precede or appear anywhere within a simple  command
or may follow a command.  Redirections are processed in the order they appear, from left to right.

Redirecting Input
    Redirection  of  input  causes  the  file  whose name results from the expansion of word to be opened for
    reading on file descriptor n, or the standard input (file descriptor 0) if n is not specified.

    The general format for redirecting input is:

           [n]<word
source manpages: ssh