SSH Socks

Introduction

This tutorial will be brief, but it’s highly effective. The utility of creating a SOCKS proxy via SSH is to be able to route any traffic through an external connection once the SSH connection is established. You simply use the proxy that SSH creates and you’re ready to go.

With SSLH as a frontend, you have an almost ultimate tool.

For more advanced techniques, I also recommend checking out the documentation on proxychains.

Usage

To establish an SSH connection while opening a SOCKS proxy, simply run this command from server A:

1
ssh -D <port> <user>@<destination>

For example:

1
ssh -D 12345 user@serverB

Once the connection is established, configure your web browser or other applications to use localhost as a SOCKS proxy on the specified port (in this case 12345).

Last updated 18 Feb 2012, 12:24 +0200. history