Connect to a console-based script remotely, and synchronize stdin and stdout