Actually, we should be able to do this by a simple system call rather than the ssh followed by a system call...