ssh2 Return Values
On normal execution,
ssh2 exits with the status of the command
run. On successful runs this is normally 0 (zero).
ssh2 encounters an error, you usually see the reason in an
error message. However, accommodating for that in, for example, batch
files is difficult, so some usual exit values for
documented here. Note that the command you have run may also return the
same exit values. Unfortunately, little can be done to avoid this, as
the exit value space is so small (8 bits).
- 128 + signal number
This is returned if
ssh2 encounters a fatal signal.
143 would be returned for SIGTERM (signal number 15).
- 64 + disconnect code
This is returned on disconnect, clean or otherwise. The disconnect codes
are the following:
host not allowed to connect 1
protocol error 2
key exchange failed 3
MAC error 5
compression error 6
service not available 7
protocol version not supported 8
host key not verifiable 9
connection lost 10
by application 11
too many connections 12
auth cancelled by user 13
no more auth methods available 14
illegal user name 15
74 would mean connection lost.
Returned on a call for
Usually means that
ssh2 failed to
(generic catch-all in the libraries for failures to
Connecting to remote host failed.