Tunnel your HTTP traffic with ssh: Difference between revisions

From XPUB & Lens-Based wiki
No edit summary
Line 15: Line 15:
* You can just open a tunnel in the background without requesting a shell session:
* You can just open a tunnel in the background without requesting a shell session:
<source lang="bash">
<source lang="bash">
ssh -D 12345 user@superserver
ssh -fND 12345 user@superserver
</source>
</source>

Revision as of 18:57, 12 January 2011

Here is the situation, you want to hide your IP behind a proxy, you need to access a resource that is blocking your IP but not the one of your proxy, etc.

You can do all that if you have an ssh account on another machine, using your ssh connection as an HTTP proxy (SOCKS type) is very easy.

  • Open a connection to the server/machine you want to tunnel your traffic through:
ssh -D 12345 user@superserver

This will open a normal ssh session to superserver and create a SOCKS proxy on your local machine on port 12345.

  • Go to your browser's networking preferences and select SOCKS as proxy pointing to your localhost on port 12345. For example on firefox:

Socks.png

Notes

  • You can just open a tunnel in the background without requesting a shell session:
ssh -fND 12345 user@superserver