0

1, There has 2 hosts which are hostA and hostB, both Linux distribution and openSSH installed;

2, hostA cannot access the public internet, but it can access hostB via ssh;

3, hostB can access the public internet, but due to firewall, if hostB want to access webpage (e.g. stackoverflow.com), we have to setup the http proxy on hostB first, this can be done either by export http_proxy=http_proxy_server:8000 in terminal, or set the http proxy on firefox with the proxy_server ip and port 8000;

4, I can setup a ssh tunnel/socket proxy by perform "ssh -D 7030 gemfield@hostB" on hostA and then set the socket proxy(localhost:7030) on firefox on hostA, but hostA still cannot access the webpage;

5, how to configure hostB(or hostA) to let firefox on hostA can access the webpage via the ssh tunnel/socket proxy?

2 Answers2

2
user@hostA# ssh -L 3128:proxyserver:3128 gemfield@hostB

Then simply set proxy to localhost:3128 on hostA.

Ipor Sircer
  • 1,226
  • 7
  • 8
  • The real http_proxy used on hostB is proxyserver:8000, so you mean ssh -L 8000:proxyserver:8000 gemfield@hostB, right? And the 1st 8000 can be changed to another local port, right? "Then simply set proxy to localhost:3128 on hostA", for the firefox, it is http proxy or socket proxy? – gemfield Sep 13 '16 at 14:36
0

It may be that hostA needs to tunnel DNS resolution through hostB as well. Try this solution:

https://superuser.com/questions/103593/how-to-do-dns-through-a-proxy-in-firefox

Jonah Benton
  • 1,252
  • 7
  • 13