Your browser does not allow storing cookies. We recommend enabling them.

SSH Tectia 
PreviousNextUp[Contents] [Index]

    About This Document>>
    Installing SSH Tectia Client >>
    Getting Started >>
    Configuring SSH Tectia Client >>
    Connecting to a Remote Host Computer>>
    Transferring Files>>
    Tunneling Applications>>
    GUI Reference>>
    Troubleshooting >>
    Command-Line Tools >>
        ssh2 >>
            ssh2 Return Values
        scp2 >>
        sftp2 >>
        ssh-keygen2 >>
        ssh-cmpclient >>
        ssh-certview >>

ssh2 Return Values

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, for example, 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. For example, 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
        reserved                         4
        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

    For example, 74 would mean connection lost.

  • -1

    Returned on a call for ssh_fatal().

  • 254

    Usually means that ssh2 failed to exec something (generic catch-all in the libraries for failures to fork or exec).

  • 1

    Generic error.

  • 2

    Connecting to remote host failed.

PreviousNextUp[Contents] [Index]

[ Contact Information | Support | Feedback | SSH Home Page | SSH Products ]

Copyright © 2010 SSH Communications Security Corp.
This software is protected by international copyright laws. All rights reserved.
Copyright Notice


Highlights from the SSH.COM blog:

  • Cryptomining with the SSH protocol: what big enterprises need to know about it

    Cryptomining malware is primarily thought of as targeting desktops and laptops and is used to hijack system resources to mine cryptocurrency.
    Read more
  • SLAM the door shut on traditional privileged access management

    Did you know that something as trivial-sounding as granting access for your developers or third parties to a product development environment can throw a gorilla-sized monkey wrench into your operations and productivity?
    Read more
  • We broke the IT security perimeter

    Everyone understands the concept of a security perimeter. You only gain access if you are identified and authorized to do so.
    Read more