How can I use ssh port forwarding to copy file across servers separated by firewall?

Solution Verified - Updated -

Issue

  • 2 servers,$SRC_SERVER and $DST_SERVER are each on networks separated by a firewall so directly ssh from one to the other is not possible. Also SSH daemons are configured to block logging in as root. Only inbound ssh connections are allowed on these server.How can I transfer a root-owned, only-root-can-read file, keeping file ownership, permissions & the modification date from $SRC_SERVER to $DST_SERVER?

Environment

  • RHEL (Any Version)
  • OpenSSH

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