Multiple-Hop SCP
This took me a while to find, so I thought I’d blog it in case future generations are searching, or anyone can tell me a simpler way.
How To SCP Via A Gateway
$ # From localhost to remotehost...
$ scp -Cp -o "ProxyCommand ssh gatewayuser@gateway nc remotehost 22" file remoteuser@remotehost:/some/where/file
$ # ...and back again.
$ scp -Cp -o "ProxyCommand ssh gatewayuser@gateway nc remotehost 22" remoteuser@remotehost:/some/where/file file_copy
Hi Kris,
thank you very much – I knew this had to be possible, and I’m very happy that I didn’t have to find out the syntax myself.
As always, quite impressive what you can do on the bash…this is the real voodoo stuff.
You made my evening…
Cheers,
Philipp
Hi, You are a life saver. Thanks.
Best Regards,
arun
Man, you are a genius!!!
I’ve been looking for the codeline for weeks!
THANK YOU.
Post new comment