ssh in OF application

i tried to search OF app that uses ssh to communicate with another laptop but no luck.
What I wanna do is simply connect to remote server, copy my file to the remote server, execute a command and parse a string back to my laptop. It’s something I do in terminal but now I want it to run when my OF app runs and uses the string from server. has anyone done something similar? or alternative solution?

Sorry for cross posting, I posted originally in basic.

If you’re on Linux/OSX you can use popen()

A really simple example would be like:

#include <iostream>  
#include <stdio.h>  
//#include <conio.h>  
#include <string>  
#include <sstream>  
#include <iostream>  
using namespace std;  
int main()  
	FILE *fp = popen("ls /", "r+" );  
	char buff[50];  
	char command[50];  
	while (fp != NULL)  
		while ( fgets( buff, sizeof buff, fp ) != NULL )   
			cout << buff;  
		cin.getline(command, sizeof command);  
		fputs(command, fp);  
	pclose( fp );  

I think you can keep that File pointer around as long as you’d like and read it whenever you need to.

Thanks, it’s really helpful.
And I have a bit further question, is there a way to deal with the ssh password prompt?

You can have passwordless ssh -