Question: I would like to run a script located on my development machine on machine B that is only accessible via machine A.

So, my development machine --(SSH)--> machineA --(SSH)--> machineB

How do I do that? The script also takes arguments.

Answer: 
What you want is a [**tunnel** via a **jump host** or **proxy**](https://en.wikibooks.org/wiki/OpenSSH/Cookbook/Proxies_and_Jump_Hosts#Passing_Through_One_or_More_Gateways_Using_ProxyJump). There are several ways of doing this based on what exactly you are trying to do, but I believe putting something like this in ~/.ssh/config locally should work for your case:

```
Host b
        ProxyJump a

```

Tested with this configuration:

```
Host localhost
    ProxyJump 127.0.0.1

```

And it works like this (trimmed to show just the hops):

```
$ ssh -v localhost 'ls ~'
Authenticated to 127.0.0.1 ([127.0.0.1]:22).
Authenticated to localhost (via proxy).
[ls output]

```
Let's say, you have the below script in the remote dev-machine. 

```
remote-machine-x$ cat /home/userA/dev/zeebash
#!/bin/bash

 echo "$@" | mail -s subject mygmailaccount@gmail.com

```

To execute this script from local machine, given that you have already set-up ssh-key, you can do it with something like this: 

```
p="hi man" ; ssh userA@remote-machine-x  "/home/userA/dev/zeebash   "$p" "

```