As the title says, how can I download a file using scp over two hops? Preferably, the files must not be stored (written to disk) at any point in the first server, just transfered through.
Using simply :
scp user1@host1:/location/of/file user2@host2:/location/of/destination
If you have a traffic forwarder (netcat, socat, etc.):
scp -o ProxyCommand="ssh FIRST_HOP socat tcp:SECOND_HOP:22 stdio" \
FIRST_HOP:/path/on/second_hop/file local/path/