login about faq

We need explanations of return or exit values of scp2 and sftp2

asked Dec 29 '10 at 20:06

SSH%20KB's gravatar image


edited Sep 21 '11 at 17:26

div class="article">When a file copy or transfer is performed, SSH Tectia Client will return a code indicating the result of the requested action(s). These codes indicate whether the requested action succeeded or not. They can be used when logging scripted transfers, so that the result of the transfer can be monitored and a specific action can be taken based on the exit code. The exit codes can be checked using the following commands:

Unix $ echo $?

Windows C:>echo %ERRORLEVEL%

Exit Codes for scp2 and sftp2

-1 Fatal error

Error message after a fatal error usually caused by wrong configuration syntax.

0 Operation was successful

1 Operation resulted in an undetermined error within sshfilecopy

There is an undetermined error. Check the command, and verify the user's access to the source and destination files and directories. Also ensure that the destination has sufficient disk space to receive the file.

2 Destination is not a directory

scp2 or sftp2 is expecting the destination to be a directory, but the destination given is a file or a non-valid directory.

3 Maximum symlink level exceeded

4 Connection to daemon failed

There is a connection problem between the client and the daemon. Resolve the connection issue before attempting the transfer again.

5 Connection was terminated for some reason

The connection with the daemon was lost.

6 File does not exist

The source file does not exist.

7 No permission to access file

The user performing the transfer does not have sufficient rights to access the source file or directory, or the destination file or directory.

8 Undetermined error from sshfilexfer

One possible reason for this error is that the destination host has run out of disk space while the transfer was in progress.

9 File transfer protocol mismatch

You are attempting to transfer from an ssh2 client to an ssh1 server, or you are attempting to transfer from an ssh1 client to an ssh2 server. The two protocols are incompatible, but some implementations support both protocols, or fallback and/or protocol emulation support may be available. Check the documentation for both the client and daemon for more information.


answered Dec 29 '10 at 20:07

SSH%20KB's gravatar image


Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: Dec 29 '10 at 20:06

Seen: 14,334 times

Last updated: Sep 21 '11 at 17:26

All user contributed content licensed under the cc-by-sa license.
Powered by OSQA.