The ssh man page says: ssh exits with the exit status of the remote command or with 255 if an error occurred. On my Fedora 8 install (openssh-4.7p1-4.fc8), it doesn't matter whether the remote command succeeds or fails, the exit status is always 0. $ ssh localhost true $ echo $? 0 $ ssh localhost false $ echo $? 0 The expected result is that "ssh localhost false" returns an exit status of 1. My CentOS 5 install has openssh-4.3p2-24.el5 and it works fine. I've tried as myself and as root, in case my own shell configuration is the cause, but I get the same result.
I cannot reproduce this problem here. Can you try ssh -vvv localhost false?
Sorry, there was something wrong with my environment. ssh was actually a wrapper script and the wrapper was doing something wrong.