Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

An example:

I am trying to use PuTTy to create an SSH tunnel from my laptop to my server (for the purposes of this example Port 22 is enabled on the router between and the Internet. is running a Privoxy HTTP Proxy on the default port of 8118. Port 8118 is not enabled on the router.

When I create a tunnel from a local port on my laptop, say 3500, to, and then configure my web browser to use localhost:3500 as a Proxy, I do not get web pages appear in my web browser - instead, I get a line of text from Open SSH describing the version number of the software in the Web Browser.

I have seen (and not fully understood) references to SOCKS and the ProxyCommand keyword in the sshd_config OpenSSH file. Am I able to utilise one/both of these in order to create a tunnel to which serves web pages, or is it absolutely neccessary that the HTTP Proxy on is exposed to the Internet?

share|improve this question

It because you're using the local port forwarding technique:

$ ssh -L

This command allocates a socket to listen to port 3500 on your laptop. And when you configure the browser to use localhost:3500 as a proxy, web traffic is forwarded over the secure channel, and a connection is made to, and in fact, you're telneting to the your server, it's why you get the SSH version:

Protocol mismatch.

You probably want to use dynamic port forwarding instead:

$ ssh -D 3500

This technique uses the application protocol to determine where to connect to from your server.

Don't forget to configure web browser to use SOCKS Host, not HTTP Proxy.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.