Bug 421011 - ssh returns wrong exit status
ssh returns wrong exit status
Product: Fedora
Classification: Fedora
Component: openssh (Show other bugs)
All Linux
low Severity low
: ---
: ---
Assigned To: Tomas Mraz
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2007-12-12 01:57 EST by Mikel Ward
Modified: 2008-08-02 19:40 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-12-19 18:13:20 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
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

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 $?

$ ssh localhost false
$ echo $?

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.

Note You need to log in before you can comment on or make changes to this bug.