This question already has an answer here:
- SCP through multiple hosts 1 answer
I have seen plenty of examples for
scp through an intermediate server to a second-hop server via
ProxyCommand operator such that:
A:/infile.txt -> B -> C:/outfile.txt
Which looks something like the following from A:
scp -o 'ProxyCommand ssh userB@hostB nc %h %p' infile.txt userC@hostC:"~/outfile.txt"
My question, is how to
scp through two intermediate servers to a third-hop server such that:
A:/infile.txt -> B -> C -> D:/outfile.txt
I'm looking for a way to do this using one-liner similar to the second-hop example provided above ... but all answers and means are valid if that's not possible.
What I'm trying to do is not the same as SCP through multiple hosts or variants thereof, which uses /etc/ssh/ssh_config file for setting up aliases. That's not what I'm wanting to do, I'm looking for a one-liner. I've also not seen any examples of two or more proxy hosts in between origin and destination, so I believe the question is quite valid.