This question already has an answer here:
I have local machine (L) and a remote machine (R) which is only reachable by hopping over (A), (B).
For transvering a file my normal routine looks likes this:
l@L$ ssh -t a@A ssh -t b@B ssh r@R r@R$ # do some stuff till I find out I want to copy file x to L
I then open a new terminal
l@L ssh a@A a@A ssh b@B b@B scp r@R:PATH_TO_FILE a@A:TEMP b@B <ctrl-D> to close a@A scp TEMP r@R l@L:FINAL_DESTINATION
scp my file over all the hops.
I wonder if there is a shell extension or program which would allow to copy files directly from R. Something akin of piping stdout@R to stdin@L to cat it. It doesn't have to be terribly efficient. As most of the time my files are small (<100kB), but it needs to support binary.