scp command fails before showing the transfer statistics

Solution Verified - Updated -

Issue

  • When copying a file to a remote system using scp, the command fails before showing the transfer statistics and some custom message usually seen with interactive shells is printed

    $ scp <myfile> root@localhost:/tmp
    <some message being printed here>
    $ echo $?
    1
    

Environment

  • Red Hat Enterprise Linux 7 and later
    • openssh scp command

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