I need to find a way to copy files from mymachine
to a server priv-server
sitting on a private NATted network via a server pub-server
with a public IP. The behind-NAT machine priv-server
only has certs for user@mymachine
, so the certs need to be forwarded from mymachine
via pub-server
to priv-server
So in order to log on with SSH with just one command, I use:
$ ssh -tA user@pub-server 'ssh user@priv-server'
— this works perfectly well. The certs are forwarded from mymachine
to priv-server
via pub-server
, and all is set up nicely.
Now, I'd normally use scp
for any file transfer needs but I'm not aware of a way to pass all of the tunneling information to scp
.