Archived post: posted sometime between 2016 and 2022.

Use ssh to run a local script with arguments on a remote host.

ssh user@host -i rsa_private_key 'bash -s arg01 arg02' < some_script.sh

See also: