1

I am new to this community , I am working on my iot project in which my microcontroller is working as a server, taking data and executing request. My client is end device (mobile,tablet) and I am connecting through SSH.

The problem appears if suddenly my internet gets off - the ssh session breaks off, and again I have to reconfigure it using this command:

ssh -o TCPKeepAlive=yes -R 80:192.145.47.33:80 example@ssh.localhost.run

And in a similar manner if the power of the server (microcontroller) gets trip off, then I get the similar situation. I want that session get automatically configured without manual intervention.

maar
  • 485
  • 6
  • 20
adil kampoo
  • 11
  • 1
  • 2

1 Answers1

5

AutoSSH is the tool you want to use for this. It starts the SSH connection and restarts it in case it breaks up.

Tero Kilkanen
  • 36,796
  • 3
  • 41
  • 63
  • 3
    And on top of that I would suggest using tmux or screen in your session so that you can recover your original shell when you reconnect. – Kate Jul 26 '20 at 11:02