Red Hat Bugzilla – Full Text Bug Listing
|Summary:||ssh returns wrong exit status|
|Product:||[Fedora] Fedora||Reporter:||Mikel Ward <mikel>|
|Component:||openssh||Assignee:||Tomas Mraz <tmraz>|
|Status:||CLOSED NOTABUG||QA Contact:||Fedora Extras Quality Assurance <extras-qa>|
|Fixed In Version:||Doc Type:||Bug Fix|
|Doc Text:||Story Points:||---|
|Last Closed:||2007-12-19 18:13:20 EST||Type:||---|
|oVirt Team:||---||RHEL 7.3 requirements from Atomic Host:|
Description Mikel Ward 2007-12-12 01:57:19 EST
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.
Comment 1 Tomas Mraz 2007-12-12 02:45:50 EST
I cannot reproduce this problem here. Can you try ssh -vvv localhost false?
Comment 2 Mikel Ward 2007-12-19 18:13:20 EST
Sorry, there was something wrong with my environment. ssh was actually a wrapper script and the wrapper was doing something wrong.