OpenSSH solaris: bad return code after exec of remote command

Aaron Bush abush at microcenter.com
Thu Oct 11 00:19:52 EST 2001


David Batterham wrote:
> 
> My problem is this. The remote ssh returns an error code of 255 (using echo $?),
> or (-1 in the debug), despite the command executing successfully. about 5-10% of
> the time it returns 0. In all cases it "appears" the command completed
> successully, and is simply an issue of ssh failing to close the channel cleanly.
> My guess is that one side is closing before the other acknowledges and therefore
> thinks the channel has been prematurely terminated.

I too have had this problem.  Using 2.9p2 a call such as:
$ ssh host "rm file"
will sometimes return 255 and other times return 0.
when the return value is not 0 i ssh back to host and confirm that the
file is 'really' removed, and in all cases the file had been removed.

-ab



More information about the openssh-unix-dev mailing list