4

The Ubuntu box I am looking at is behind a proxy which supports CONNECT to 80/443 ports. I have set up an outside ssh server on port 443 and can connect to it with corkscrew / ssh without any problems

ssh_config:

Host * ProxyCommand corkscrew corp.proxy.ip 8080 %h %p 

command line to start ssd:

ssh -D 1080 [email protected] -p 443 

So as I said it all works just fine. The problem is though that -D parameter, which supposed to open up a SOCKS proxy does not quite work.

When I run proxychains that's what I get:

 user@laptop:$ proxychains git pull ProxyChains-3.1 (http://proxychains.sf.net) random chain (1):....127.0.0.1:1080....can't connect to..corp.proxy.ip:8080 

So it seem to initiate a connection to proxy again for some reason.

Similar set up works just fine on windows machine (Bitvise Tunneller/Freecap), all tunnelling works fine.

I have tried to that:

  1. started ssh with -D, having proxy in the config
  2. commented proxy while (1) still runs
  3. ran proxychains

This time ssh did not try to connect to the proxy and connection went fine, but editing config every time back and forth is hardly a solution.

So any ideas how to fix properly?

Thanks!

1 Answer 1

4

Solution is quite simple after all: make ssh connect to proxy ONLY when it needs to establish a tunnel for the first time:

ssh_config:

Host external-host.com ProxyCommand corkscrew corp.proxy.ip 8080 %h %p 

That works cool.

Thanks for watching, everybody :)

1
  • I wonder if using a ControlMaster would help so that it only opens the initial connection once and leaves it in the background for other requests to utilize. Commented Nov 25, 2020 at 15:57

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.