Results 1 to 6 of 6

Thread: ssh command returns error

  1. #1

    Default ssh command returns error

    I have a service on my Suse 11 server which runs an ssh command (using openSSH) on another box. The output below is returned, but legitimate output is also returned as if the command had executed successfully. For example, the service executes an ls command through ssh, gets the error below, but also the contents of the remote directory as output. This is a problem because the service retries the command until it receives no error. I have been unable to replicate this manually from the command line. Does anyone know what might cause this or what this error really means?

    exit status: 255, SSH exits with the exit status of the remote command or with 255 if an error occurred,

  2. #2
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: ssh command returns error

    Try adding -v to the ssh command to see additional details.

  3. #3

    Default Re: ssh command returns error

    Output with the -v option, the exit status seems to be different than when the service runs the command


    OpenSSH_5.1p1, OpenSSL 0.9.8h 28 May 2008
    debug1: Reading configuration data /etc/ssh/ssh_config
    debug1: Applying options for *
    debug1: Connecting to <IP ADDRESS> [<IP ADDRESS>] port 22.
    debug1: Connection established.
    debug1: permanently_set_uid: 0/0
    debug1: identity file /etc/vcl/vcl.key type 1
    debug1: identity file /etc/vcl/vcl.key type 1
    debug1: Remote protocol version 2.0, remote software version dropbear_0.49
    debug1: no match: dropbear_0.49
    debug1: Enabling compatibility mode for protocol 2.0
    debug1: Local version string SSH-2.0-OpenSSH_5.1
    debug1: SSH2_MSG_KEXINIT sent
    debug1: SSH2_MSG_KEXINIT received
    debug1: kex: server->client aes128-cbc hmac-md5 none
    debug1: kex: client->server aes128-cbc hmac-md5 none
    debug1: sending SSH2_MSG_KEXDH_INIT
    debug1: expecting SSH2_MSG_KEXDH_REPLY
    debug1: Host '<IP ADDRESS>' is known and matches the RSA host key.
    debug1: Found key in /root/.ssh/known_hosts:1
    debug1: ssh_rsa_verify: signature correct
    debug1: SSH2_MSG_NEWKEYS sent
    debug1: expecting SSH2_MSG_NEWKEYS
    debug1: SSH2_MSG_NEWKEYS received
    debug1: SSH2_MSG_SERVICE_REQUEST sent
    debug1: SSH2_MSG_SERVICE_ACCEPT received
    debug1: Authentications that can continue: publickey,password
    debug1: Next authentication method: publickey
    debug1: Offering public key: /etc/vcl/vcl.key
    debug1: Server accepts key: pkalg ssh-rsa blen 149
    debug1: read PEM private key done: type RSA
    debug1: Authentication succeeded (publickey).
    debug1: channel 0: new [client-session]
    debug1: Requesting no-more-sessions@openssh.com
    debug1: Entering interactive session.
    debug1: Sending environment.
    debug1: Sending env LANG = en_US.UTF-8
    debug1: Sending command: ls -1 /vmfs/volumes/VCL/golden 2>&1
    debug1: Received SSH2_MSG_UNIMPLEMENTED for 8
    Vista-VCL
    debug1: channel 0: free: client-session, nchannels 1
    Transferred: sent 1848, received 1216 bytes, in 0.0 seconds
    Bytes per second: sent 68325.6, received 44958.8
    debug1: Exit status -1

  4. #4

    Default Re: ssh command returns error

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    Is it possible your server or client has disabled the option to run remote
    commands?

    Good luck.





    On 02/26/2010 03:06 PM, rjohn06 wrote:
    >
    > Output with the -v option, the exit status seems to be different than
    > when the service runs the command
    >
    >
    > OpenSSH_5.1p1, OpenSSL 0.9.8h 28 May 2008
    > debug1: Reading configuration data /etc/ssh/ssh_config
    > debug1: Applying options for *
    > debug1: Connecting to <IP ADDRESS> [<IP ADDRESS>] port 22.
    > debug1: Connection established.
    > debug1: permanently_set_uid: 0/0
    > debug1: identity file /etc/vcl/vcl.key type 1
    > debug1: identity file /etc/vcl/vcl.key type 1
    > debug1: Remote protocol version 2.0, remote software version
    > dropbear_0.49
    > debug1: no match: dropbear_0.49
    > debug1: Enabling compatibility mode for protocol 2.0
    > debug1: Local version string SSH-2.0-OpenSSH_5.1
    > debug1: SSH2_MSG_KEXINIT sent
    > debug1: SSH2_MSG_KEXINIT received
    > debug1: kex: server->client aes128-cbc hmac-md5 none
    > debug1: kex: client->server aes128-cbc hmac-md5 none
    > debug1: sending SSH2_MSG_KEXDH_INIT
    > debug1: expecting SSH2_MSG_KEXDH_REPLY
    > debug1: Host '<IP ADDRESS>' is known and matches the RSA host key.
    > debug1: Found key in /root/.ssh/known_hosts:1
    > debug1: ssh_rsa_verify: signature correct
    > debug1: SSH2_MSG_NEWKEYS sent
    > debug1: expecting SSH2_MSG_NEWKEYS
    > debug1: SSH2_MSG_NEWKEYS received
    > debug1: SSH2_MSG_SERVICE_REQUEST sent
    > debug1: SSH2_MSG_SERVICE_ACCEPT received
    > debug1: Authentications that can continue: publickey,password
    > debug1: Next authentication method: publickey
    > debug1: Offering public key: /etc/vcl/vcl.key
    > debug1: Server accepts key: pkalg ssh-rsa blen 149
    > debug1: read PEM private key done: type RSA
    > debug1: Authentication succeeded (publickey).
    > debug1: channel 0: new [client-session]
    > debug1: Requesting no-more-sessions@openssh.com
    > debug1: Entering interactive session.
    > debug1: Sending environment.
    > debug1: Sending env LANG = en_US.UTF-8
    > debug1: Sending command: ls -1 /vmfs/volumes/VCL/golden 2>&1
    > debug1: Received SSH2_MSG_UNIMPLEMENTED for 8
    > Vista-VCL
    > debug1: channel 0: free: client-session, nchannels 1
    > Transferred: sent 1848, received 1216 bytes, in 0.0 seconds
    > Bytes per second: sent 68325.6, received 44958.8
    > debug1: Exit status -1
    >
    >

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v2.0.12 (GNU/Linux)
    Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

    iQIcBAEBAgAGBQJLiE5WAAoJEF+XTK08PnB5kf8QAKR6/LYJoBPZd0we5wGxITFC
    /RZFBBamwHWdl6jufffANfahzdzWS2MANJpUo8QXsKT9nQaycKN6S7K2QJJU8dXF
    MzQTGXjZ8QvBIo3mL2AHkf4R0GnoJRrpnbbXngs6KrCsToE/O3dih+tUetcvyWQ1
    HtvlWuuCxZp0Jg4komANZdXmTc+okLuLn3sIa3CKUPX7lU/XVV77bnvaiQu1PGl/
    5qU4I1rzu6iCAsqfWLp6ySgoGaavHRqHDrqk09wUCjrCEgQ/2VQNUd1NYfKmbDG1
    CLOPSK+29YedSMRtFBUMY4m43VCECcsinu80vMjpoDj/BV9nUjThAnxf8JHH4eZ4
    Sp6rpoZf/UmLpH4frI/c3gfwb2XvOPXkuk0lu9iShVsJTnftmUJVFvW8HSglHfAm
    wqVrpUXvuvJg5Ej/ykEheD6juFgW5YtvlFQcOg787ugKc4et/3i0xfzeFXApX7OP
    DGHWVi6NJ1kPey5+sEFs7U7C+orfSJjHAUrTz/PQ1uaEqNOMu1BSJubQiY4iT7Ir
    tE4EMUqnn876XaGr36iL/ev6VycD0oFWoQIW2MmlCJQKHNGVI70MKtV680DXm07/
    JrX0fUobELx/bPflE+tuMfvMKp8nGQ3zWnvBIspS+WyaDhHoPGor381bZSQwDG0T
    jKT7s2RsAE8bo4fDwfbW
    =e+8L
    -----END PGP SIGNATURE-----

  5. #5
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: ssh command returns error

    I see you are using dropbear on the other end. This may be the issue:

    debug1: Received SSH2_MSG_UNIMPLEMENTED for 8

    You could try -vv to get even more detail about what that unimplemented functionality in dropbear is to work out if you can tell ssh not to ask for it.

    Or you could ignore the status return from the ssh command.

  6. #6

    Default Re: ssh command returns error

    The server I am trying to run commands on is Esxi 3.5 update, I know that remote commands such as editing VM's were disabled, this might have something to do with my problem. Thanks for the replies

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •