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

Is it possible to use socat to achieve the following, without the need of using ssh?

> ssh -N -R 8080:localhost:1080

-R [bind_address:]port:host:hostport
  Specifies that the given port on the remote (server) host is to be forwarded to the given host and port on the local side.
  This works by allocating a socket to listen to port on the remote side, and whenever a connection is made to this port, 
  the connection is forwarded over the secure channel, and a connection is made to host port hostport from the local machine.

-N  Do not execute a remote command.  This is useful for just forwarding ports (protocol version 2 only).
share|improve this question

Probably not. While socat can certainly forward port 8080 on your local system to port 1080 on the remote system, it can't change your point of origin -- you'll still be connecting from your local system.

Using ssh, the connection is forwarded over an ssh tunnel such that when something connects to port 1080 on the remote system, it appears to be originating on that system as well. This has substantial implications if there are firewalls preventing external access to that port (or if the corresponding process is only listening on the loopback interface).

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.