Simple reverse tunnels for your PIs!

The other day I was developing an application intended to be run on a set of distributed raspberry pi’s. The application setup is not trivial I and do expect a fair bit of problems once the devices are deployed. It is therefore important for me to be able to troubleshoot and collect information from the devices whenever I need to. The collection of information can probably be automated by letting them push logs to a central repository. But that does not allow me to correct issues or upgrade the software directly on the devices.

The ideal solution would be to be able to open an ssh session to each of the deployed devices at any time. It is usually not possible to address the devices directly since they will be using 3G dongles to connect to the rest of the world. Therefore I opted to set up reverse tunnels from the devices to a central node which I can address directly. After a couple of iterations of setting up reverse tunnels manually I was dismayed. It is boring and error prone.


Read More