1

I'm trying to tunnel all my web traffic to a remote linux server (A) but I can't access it from my local windows machine. However there is a computer (B) which I have access to, which happens to have access to the (A) machine.

So my goal is use machine B to access machine A and tunnel all my traffic through it.

I thought maybe instead of

ssh -N -D 1080 user@machine-A

I could do something like:

ssh -N -D 1081 user@machine-B
ssh -N -D 1080 user@machine-A --use "1081"
Hassan
  • 213

1 Answers1

1

I think you coult try it, but not exactly like that.

The -D switch you use, refers to dynamic port forwarding, which opens a socks 5 proxy on your local pc and tunnels all the trafic to the ssh pc.

So, in machine B, by issuing

B$ ssh -N -D 1080 user@machine-A 

you create a proxy on machine B on the 1080 port that tunnels all the trafic to machine A

Then, in your local machine, you need to instruct ssh to tunnel all your trafic to the specific port of machine B

An appropriate way of doing so would be to use,

ssh -R 1080:localhost:1080 user$machine-B

Then, all the trafic would go from local port 1080, to machine-B 1080 and then to machine A.

I think that this setup should do the job you are trying to accomplish.