in reply to system command problem

One thing to try -- use ssh's -v flag to get verbose output. Of course you'll have to capture the output...

bluto