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

I'm using Mac 10.7.4 and I have an HTTP service running on port 8082 of a remote server, which I can only access through an intermediate server. So I execute these tunnel commands

ssh -L 8082:remote-server:22 dalvarado@intermediate-server
ssh dalvarado@localhost -p 8082

However, when I open a web browser (either Safari or Chrome) and visit


I get the error

Protocol mismatch.

I have verified that the remote-server's sshd_config file contains "Protocol 2" and I even tried adding the "-2" flag to the above SSH commands, but I'm still getting the error.

Any help is appreciated, - Dave

share|improve this question
up vote 4 down vote accepted

You should be able to do this with a single tunnel, provided that the intermediate server's settings allow this:

ssh -L 8082:remote-server:8082 dalvarado@intermediate-server

Then point your browser to


If remote-server:8082 is only accessible from remote-server itself, you need to tunnel further:

ssh -L 8022:remote-server:22 dalvarado@intermediate-server
ssh -L 8082:localhost:8082 dalvarado@localhost -p 8022

Then point your browser to http://localhost:8082/

share|improve this answer
I tried running your SSH command but then visiting the URL produces the error, "No data received". I know there is a web page there because when I execute "wget localhost:8082/"; on the remote-server, I get an index.html page. – Dave Aug 24 '12 at 16:13
What happens if you ssh to the intermediate server, and then from there execute "wget remote-server:8082" ? – brain99 Aug 24 '12 at 16:43
I get a "Connection to remote-server failed: Connection timed out" message – Dave Aug 24 '12 at 18:52
I have edited my original answer with a possible solution – brain99 Aug 24 '12 at 19:54
You have tried ssh -L 8082:remote-server:22 dalvarado@intermediate-server So a connection to localhost:8082 is forwarded to the port 22 (SSH service) of the remote server. It is not what you want since you obviously wants to access a HTTP service. Try ssh -L 8082:remote-server:80 dalvarado@intermediate-server instead – philippe Aug 26 '12 at 16:30

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.