the old sftp2 client from Tectia 4.x uses the same exit values as ssh2. In normal operation the return code zero means that the executed operation was successful. Please find information about SFTP2/SSH2 return codes from below:
On normal execution, ssh2 exits with the status of the
command run. On successful runs this is normally 0 (zero).
If ssh2 encounters an error, you usually see the reason in
an error message. However, accommodating for that in e.g.
batch files is difficult, so some usual exit values for
ssh2 are 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.
E.g. 143 would be returned for SIGTERM (signal num-
64 + disconnect code
This is returned on disconnect, clean or otherwise.
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
E.g. 74 would mean 'Connection lost'.
-1 Returned on a call for ssh_fatal().
254 Usually means that ssh2 failed to exec(3) something
(generic catch-all in the libraries for failures to
fork(2) or exec(3)).
1 Generic error, usually because invalid command-line
options or malformed configuration.
2 Connecting to remote host failed.
Please note that the more current Tectia SFTP client, the SFTPG3 client (in 5.x/6.x series), will have its own return codes and you can find those from here:
Hopefully this helps!
Oct 15 '10 at 21:46
Sami Marttinen 1