I have a Mac OS X server (referred to as the internal server behind a firewall that is reverse port forwarding via
ssh -gnN -R *:remoteport:localhost:localport email@example.com where remote.server is the domain/IP of a public server, which I will call the remote server. Then, I can connect to the internal server by connecting to
Periodically, the tunnel will fail, and to that end I have a script on the internal server that tries to reconnect to the remote server until it succeeds. This has worked on several occasions.
But recently, I experienced an error in which the internal server loses its connection to the remote server, and nothing I do on the internal server can restore the connection. The remote server must be rebooted, after which the tunnel is immediately reestablished by the script.
The remote server is a VPS running a base install of CentOS 6. No configuration has changed in the last few months. The remote server ran the tunnel without errors for over 4 months, then failed twice in the last 12 hours in this manner, requiring two reboots only hours apart.
What kinds of things could cause this behavior, and where should I start looking for problems?