Remote Execution, has various uses, including distributed computation, remote access, remote file access, rely on remote execution.
The original remote execution schemes were telnet and rsh, but there is no reason at all for using either of those if you can possibly use ssh instead.
One common approach is to drive ssh as a subprocess, often with the help of Expect.