Mobaxterm: how to prevent ssh session from exiting?
If you are still looking for the answer like me, here you go! Settings -> Configuration -> SSH -> SSH keepalive Restart MobaXTerm after changing the setting for it to take effect. https://superuser.com/a/1298536