scp return codes are random

From: Sam Robertson (samr_at_proofpoint.com)
Date: 11/23/03

  • Next message: Darren Tucker: "Re: scp return codes are random"
    Date: Sat, 22 Nov 2003 21:11:40 -0800
    To: secureshell@securityfocus.com
    
    

    I'm using openssh-3.7.1p2 on one machine and connecting to a Solaris 9
    system running Sun_SSH_1.0. I'm really not quite sure which version of
    OpenSSH this is or if it's even OpenSSH anymore.

    Anyway, I've tried the following with 3.7p1, 3.5p1, 3.7.1p2 and have
    the same results in all cases.

    Using the following test program

    ---
    cmd="/workdir/openssh-3.7.1p2/bin/scp -oProtocol=2 -q -S 
    /workdir/openssh-3.7.1p2/bin/ssh -B /etc/passwd startrek1:/tmp"
    ${cmd}
    echo "Returned: $?"
    ---
    So when I run this in a simple while loop and even ensure that the 
    remote file is removed from /tmp, I get random return codes:
    ---
    [startrek2]$ while /bin/true ; do sleep 1 ; 
    /workdir/openssh-3.7.1p2/bin/ssh -2 startrek1 "rm -f /tmp/passwd" ; 
    ./scptest.sh ; done
    Returned: 1
    Returned: 1
    Returned: 1
    Returned: 0
    Returned: 1
    Returned: 1
    ---
    I can't for the life of me figure out why this is happening.  Running 
    scp with -v and diffing a successful run with an unsuccessful run 
    results in:
    ---
    [startrek2]$ diff -u bad-result good-result
    --- results     Sat Nov 22 20:00:58 2003
    +++ results2    Sat Nov 22 20:01:06 2003
    @@ -37,6 +37,7 @@
     debug1: Entering interactive session.
     debug1: Sending command: scp -v -t /tmp/passwd
     Sending file modes: C0644 6918 passwd
    +debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
     debug1: channel 0: free: client-session, nchannels 1
     debug1: fd 0 clearing O_NONBLOCK
     debug1: fd 1 clearing O_NONBLOCK
    @@ -43,5 +44,5 @@
     debug1: fd 2 clearing O_NONBLOCK
     debug1: Transferred: stdin 0, stdout 0, stderr 0 bytes in 0.1 seconds
     debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 0.0
    -debug1: Exit status -1
    -Cmd returned: 256 256
    +debug1: Exit status 0
    +Cmd returned: 0 0
    ---
    So is there something I'm missing or is this a client & server mis-match 
    problem?  Additionally, I'm not seeing this under Linux, it seems to 
    manifest itself only with connecting to the default installed SSH client 
    that comes with Solaris 9.
    Sam
    

  • Next message: Darren Tucker: "Re: scp return codes are random"

    Relevant Pages

    • Re: Kerberos, external-keyx authentication, Mac OS X
      ... OpenSSH has been configured with the following options: ... PAM support: no ... debug1: Connecting to server.gov port 22. ... If you use Kerberos in the ...
      (comp.security.ssh)
    • Ora-rg could not start using scswitch command!
      ... So oracle server could not be started. ... Is Shockwave Plugin available for Solaris??? ... debug1: read PEM private key done: type RSA ...
      (SunManagers)
    • PubKey Auth from F-Secure to OpenSSH - not working
      ... I have PubKey Auth working fine from OpenSSH to F-Secure. ... debug1: kex_derive_keys ... userauth-request for user perfboy service ssh-connection ... Failed none for perfboy from <remote srv IP> port 33865 ssh2 ...
      (comp.security.ssh)
    • Re: OpenSSH Password Authencation with SSH2 server
      ... > OpenSSH Password Authencation works with another OpenSSH server after: ... > For OpenSSH Password Authencation with a SSH2 server I did the following: ... > debug1: Connection established. ...
      (comp.security.ssh)
    • OpenSSH 3.4p1 on FreeBSD and pam-opie module
      ... OpenSSH 3.4 is having quite a few problems with authentication. ... debug3: Trying to reverse map address 192.168.0.3. ... debug1: userauth-request for user astjean service ssh-connection method ... debug2: input_userauth_request: setting up authctxt for astjean ...
      (comp.security.ssh)