1

I'm having a hard time describing the error, sorry for the lengthy explanation:

I have a successful, working, stable reverse AutoSSH solution nailed up between a client beagle board and a server. The beagle board is on a GCN NATed 3G connection, the Server has a real routeable IPv4 address. I allow direct connections to my services by having "GatewayPorts Yes" set on the Server's sshd_config file (i.e. directly pass through the Server acting as a proxy).

This solution works very well and is very durable against all sorts of disconnects... except this: The reverse AutoSSH sessions are still alive even during the error, yet the gateway port on the Server falls silent. I think the error is wholly contained in the Server. the AutoSSH client never sees the error and doesn't attempt to correct it.

Here is the output of netstat -anp on the server. I have three reverse autoSSH sessions nailed up on ports 64,65,66. Note how port 64 is missing from the listening side of the server, its currently experiencing the error. I've simplified and anonymized the output. In reality, the reverse ports are way up in the 30000's.

AutoSSH Server IP: 1.1.1.1

AutoSSH Client BeagleBoard's ISP IP (remember the device is actually hopelessly behind a GNC and NAT): 2.2.2.2

Me using one of the AutoSSH proxied services: 3.3.3.3

Active Internet connections (servers and established)

Proto Recv-Q Send-Q Local Address         Foreign Address         State       PID/Program name

tcp        0      0 1.1.1.1:22            2.2.2.2:46154           ESTABLISHED -
tcp        0      0 1.1.1.1:22            2.2.2.2:54006           ESTABLISHED -
tcp        0      0 1.1.1.1:22            2.2.2.2:39334           ESTABLISHED -
tcp        0      0 1.1.1.1:65            3.3.3.3:29860           ESTABLISHED -
tcp6       0      0 :::65                 :::*                    LISTEN      -
tcp6       0      0 :::66                 :::*                    LISTEN      -
tcp6       0      0 :::22                 :::*                    LISTEN      -

*note port 64 is missing yet there are three reverseSSH sessions nailed up from the AutoSSH client. I cannot access port 64 services until i manually reset the ReverseSSH session.

The only way i'm able to recover from this is to kill the existing SSH tunnels by any method of my choosing (wait for the 3G provider to kill the established SSH session, killing the ssh processes on the client, bouncing the network port, rebooting SSHD on server, rebooting client or server, ect...). AutoSSH automatically recovers and the ReverseSSHed service reappears on the LISTENING side:

Active Internet connections (servers and established)

Proto Recv-Q Send-Q Local Address         Foreign Address         State       PID/Program name

tcp        0      0 1.1.1.1:22            2.2.2.2:46154           ESTABLISHED -
tcp        0      0 1.1.1.1:22            2.2.2.2:54006           ESTABLISHED -
tcp        0      0 1.1.1.1:22            2.2.2.2:39334           ESTABLISHED -
tcp        0      0 1.1.1.1:65            3.3.3.3:29860           ESTABLISHED -
tcp6       0      0 :::64                 :::*                    LISTEN      -
tcp6       0      0 :::65                 :::*                    LISTEN      -
tcp6       0      0 :::66                 :::*                    LISTEN      -
tcp6       0      0 :::22                 :::*                    LISTEN      -

*note port 64 has returned after bouncing all connections.

It happens randomly to all of the ReverseSSHed services. On average about once a day for any one of the three services.

Any idea what could be causing this or where to start looking in the logs? The SSH logs do not indicate a failure.

Thank you for your insight.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.