I've got multiple reverse ssh tunnels set up from remote raspberry pis, running debian jessie. The RPIs use a 3G dongle to gain intrnet connectivity, which is why im using reverse ssh to remotely log in. Each RPI sets up a reverse ssh tunnel to a cloud server, which i use to log into each system.
The ssh tunnels are set up as follows:
ssh -N -o ExitOnForwardFailure=yes -R 23xx:localhost:22 username@178.x.x.xxx
where 23xx is the port used to forward connections from port 22, and 178.x.x.xxx is the ip address of the server.
My problem is that sometimes when i try to ssh into a system, it hangs forever, with no error as follows:
ssh pi_username@localhost -p 23xx
The terminal just does not output anything after that and hangs forever. When i try to debug using -vvv this is what i get:
ssh pi_username@localhost -p 23xx -vvv
OpenSSH_6.7p1 Debian-5+deb8u4, OpenSSL 1.0.1t 3 May 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to localhost [::1] port 23xx.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /home/master/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/master/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/master/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/master/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/master/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/master/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/master/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/master/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.7p1 Debian-5+deb8u4
It looks like the connection is established, but the login does not not get prompted. Any ideas? Any recommendation on how to further debug?