Create and maintain a reverse ssh tunnel.
I have some computers located behind firewalls and/or NAT, but I need to access these machines remotely. The network address often changes, and the network connection is not reliable. In some cases, the network connection can only be established from the remote computer. The remote tunnel script provides a way to access these computers fairly reliably.
This script establishes an ssh tunnel and tries to maintain it using autossh. It can be run many times - if the tunnel is established, then the script does nothing.
To use this script, run it repeatedly as a cron task on the remote system. For example:
When the connection has been establish, connect to the remote system by logging in to the local system then doing this:
Copyright © 2011 Matthew Wall, all rights reserved