One simple solution would be to use a binary file sshand call it from your program. Create 3 channels using pipe(), then fork(), the close()corresponding endpoints (not necessary if necessary), so you have 2 processes with 3 pipes in between. In the child language, dup2()the pipeline endpoints to stdin, stdout and stderr (i.e., Fd 0, 1, 2) and exec()to the ssh command.
. RSA-, .
, ; -)