News for hackers. Stuff that matters.
Re:A little SSH file copy magic at the command line by crispyambulance on Thursday October 10, 2019 @10:44AM (#21215068)
There is one piece of information, I think, that isn't obvious and needs to be communicated. Since I am anonymous, I am not embarrassed to ask even on HN.

If you copy a file using this method from host B to host C by issuing an scp command on host A, do the bits go directly from host B to host C? or do they go through host A on their way to host C ?

I suspect the latter is what happens on Windows network fileshares, because it takes significantly longer to perform a file transfer from \\hostB to \\hostC while in \\hostA than just doing it direct from \\hostB or \\hostC.

What happens in linux behind the scenes for such 3-party scp transfers?

Re:A little SSH file copy magic at the command line by bakies on Thursday October 10, 2019 @10:51AM (#21215150)
scp has a -3 option so you decide whether the data travels through your local system or not

     -3      Copies between two remote hosts are transferred
             through the local host.  Without this option the
             data is copied directly between the two remote
             hosts.  Note that this option disables the
             progress meter.
Re:A little SSH file copy magic at the command line by rovr138 on Friday October 11, 2019 @12:45AM (#21221628)
It’s what you suspected. It uses host a as a proxy. It downloads from host b to host a and uploads from host a to host c.
Re:A little SSH file copy magic at the command line by pssflops on Thursday October 10, 2019 @11:34AM (#21215716)
Thank you for asking this! I was ignorant of the same process and held the same theory for Windows filetransfers.