libssh2 scp file transfer (eg. curl) fails to some server implementations (not OpenSSH)

Solution In Progress - Updated -

Issue

  • libssh2 scp file transfer (eg. curl) fails to some server implementations (not OpenSSH)

    # curl -v -L -u user:"" --insecure -T ~/file.txt scp://host.domain.com/file-curl-scp
    <snip>
    * Authentication complete
    * SSH CONNECT phase done
    * failed to send file
    * Connection #0 to host host.domain.com left intact
    curl: (79) failed to send file
    
  • The libssh2 transfer may also fail; however curl exits with return code of zero. Was able to trigger this slightly different error message simply by using ~ to indicate user's home directory for file upload.

    # curl -v -L -u user:"" --insecure -T ~/file.txt scp://host.domain.com/~/file-curl-scp-tilde
    <snip>
    * Authentication complete
    * SSH CONNECT phase done
    } [data not shown]
    * We are completely uploaded and fine
    * Channel failed to close: -34 <------------------------- Actually FAILED!!!
    * Connection #0 to host host.domain.com left intact
    
    # echo $?
    0
    

Environment

  • Red Hat Enterprise Linux 7
  • libssh2-1.4.3-10.el7_2.1 (and older)

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content