O novo openssh
7.3 fornece a opção -J
, que permite que você crie o seu one-liner desejado:
scp -oProxyJump=userB@hostB,userC@hostC infile.txt userD@hostD:"~/outfile.txt"
Na página de manual :
ProxyJump
Specifies one or more jump proxies as
[user@]host[:port]
. Multiple proxies may be separated by comma characters and will be visited sequentially. Setting this option will cause ssh(1) to connect to the target host by first making a ssh(1) connection to the specified ProxyJump host and then establishing a TCP forwarding to the ultimate target from there.