Let’s say we have three machines: A, B and C.
- Machine A can't reach machine B from any network, so I can't send files between both.
- But both A and B can be reached from C (my machine).
Today I have to copy a huge file from A to B.
Currently I would need to copy it first from A to C and then from C to B. Is there a way to connect or pipe the scp
to stream the incoming data to the target machine without need to save in the middle?
ssh user1@A "scp from_file user2@B:to_file"
– Vlad Havriuk Aug 26 '21 at 19:24scp
use-3
mode by default, in which case this should work. – Barmar Aug 27 '21 at 13:55