Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

> ssh -N -R 8080:localhost:1080 mylogin@server.com

-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
add comment

1 Answer 1

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
add comment

Your Answer

 
discard

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.