Home » Questions » Computers [ Ask a new question ]

Stable reverse port forwarding in SSH and stale sessions

Stable reverse port forwarding in SSH and stale sessions

Using VPS to forward ports behind NAT:

Asked by: Guest | Views: 291
Total answers/comments: 2
Guest [Entry]

"Looks like AutoSSH is the right thing for this.

Autossh is a program to start a copy of SSH and monitor it, restarting it as necessary should it die or stop passing traffic. The original idea and the mechanism were inspired by RSTunnel (Reliable SSH Tunnel).

With version 1.2 the method changed: autossh began to use SSH to construct a loop of SSH forwardings (one from the local machine to the remote, and one from the remote to the local), and then send test data that it expects to get back. (The idea was thanks to Terrence Martin.)

With version 1.3, a new method was added (thanks to Ron Yorston): a port may be specified for a remote echo service that will echo back the test data. This avoids the congestion and the aggravation of making sure all the port numbers on the remote machine do not collide. The loop-of-forwardings method remains available for situations where using an echo service may not be possible.

Features


autossh is a program to start a copy of ssh and monitor it, restarting it as necessary should it die or stop passing traffic. The idea is from rstunnel (Reliable SSH Tunnel), but implemented in C.
The author's view is that it is not as fiddly as rstunnel to get to work.
Connection monitoring using a loop of port forwardings or a remote echo service.
Backs off on rate of connection attempts when experiencing rapid failures such as connection refused.
Compiled and tested on OpenBSD, Linux, Solaris, Mac OS X, Cygwin, and AIX; should work on other BSDs.
Freeware."
Guest [Entry]

"Looks like AutoSSH is the right thing for this.

Autossh is a program to start a copy of SSH and monitor it, restarting it as necessary should it die or stop passing traffic. The original idea and the mechanism were inspired by RSTunnel (Reliable SSH Tunnel).

With version 1.2 the method changed: autossh began to use SSH to construct a loop of SSH forwardings (one from the local machine to the remote, and one from the remote to the local), and then send test data that it expects to get back. (The idea was thanks to Terrence Martin.)

With version 1.3, a new method was added (thanks to Ron Yorston): a port may be specified for a remote echo service that will echo back the test data. This avoids the congestion and the aggravation of making sure all the port numbers on the remote machine do not collide. The loop-of-forwardings method remains available for situations where using an echo service may not be possible.

Features


autossh is a program to start a copy of ssh and monitor it, restarting it as necessary should it die or stop passing traffic. The idea is from rstunnel (Reliable SSH Tunnel), but implemented in C.
The author's view is that it is not as fiddly as rstunnel to get to work.
Connection monitoring using a loop of port forwardings or a remote echo service.
Backs off on rate of connection attempts when experiencing rapid failures such as connection refused.
Compiled and tested on OpenBSD, Linux, Solaris, Mac OS X, Cygwin, and AIX; should work on other BSDs.
Freeware."