in reply to channel SSH2

Following-on to Salva's suggestion, consider constructing a shell-script file, copying it to the host via sftp, then executing it (either directly, if it is marked executable, or indirectly through a command like source).   The host computer will perceive that it has one file to execute which specifies an entire series of commands, and it will execute them all and send you all of the output therefrom.   You will, of course, need to know how to evaluate that (combined...) output.   You could also construct a more elaborate script for the host to execute.   As an aside, I find it very useful to employ templating tools such as Template::Toolkit in situations like these, even though those tools are customarily used in web-sites.   This makes it very easy for you to “tweak” exactly what command-file you send over, without substantially altering the code.

If the individual commands in question are big, hairy things, that take a long time to execute and so on, then maybe what you actually have is a “run batch-jobs” situation, and you should consider using batch execution software to submit them, run them, and to collect their output.