Execute scp via http Proxy

linux

In a tightly configured network policy environment, where every single connection must go through a proxy, a simple task such as file transfer would be a hassle.

A simple scp connection also would be denied if it is not through a proxy.

However it still can be achieve with following additional internal paramater.

scp -o "ProxyCommand=nc --proxy <proxyHost>:<proxyPort> --proxy-type http %h %p" root@<remoteHost>:<remotePort>


Explanation

-o "ProxyCommand=nc --proxy <proxyHost>:<proxyPort> --proxy-type http %h %p"

  1. Supply an option, where will be proxy-ing via nc with ProxyCommand=nc
  2. Define the proxy host and port with --proxy <proxyHost>:<proxyPort>.
  3. Define the type of proxy as http with --proxy-type http %h %p