Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 looking for an equivalent of this:

ssh -R 8888:

ie. make the service running on port 8888 on the local machine ( look like a locally running service on a remote machine (

However, I don't want the encryption overhead of ssh, since the service in question is https and is thus already encrypted.

Can anyone suggest a tool to do this? Note that the direction of the initiation is important here - ie. it's the equivalent of a reverse tunnel. The local machine, where the service is running, is on a private network and not directly visible to the remote machine; the remote machine has a public IP though.

  • unix (OS X and Linux) on each end
  • I have full access to both machines
share|improve this question

A pair of netcat sessions would fit the bill, I guess.

man nc

share|improve this answer

Just set ssh's encryption cypher to none.

ssh -c none -R 8888:
share|improve this answer
Not possible on most platforms without the use of a third-party patch. – Dan Carley Jun 16 '09 at 8:21
Probably just as well, it really does nerf the secure bit of ssh. – Haakon Jun 16 '09 at 12:48

do not forget socat, the swiss army knife of network forwarders ;)

share|improve this answer
Nice ! I didn't know it. – sebthebert Jun 17 '09 at 17:14

An inetd combined with netcat should do the trick. See Forwarding Ports, although xinetd may be a better choice these days.

share|improve this answer

I have used rinetd for this in the past with great success.

rinetd is a very small, stable, and simple program that listens for incoming connections and forwards them, the configuration is really simple

# bindadress    bindport  connectaddress  connectport         80         80         443         443

There is also a program called "stone" that can do the same: Example... http forward from the gateway to an internal machine (

$ stone 80
share|improve this answer

You could use some sort of firewall rule? Something in iptables to redirect one port to another?

share|improve this answer

What you are trying to use smells like NAT Port Forwarding to me. One iptables rules and it's done.

share|improve this answer

Your Answer


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