But often web hosting campanies that provide SSH access to their clients, limit the time of an inactive connection for performance and security reasons, which can be annoying sometimes, you have to launch from time to time some bach commands to leave the connection alive.
Digging a bit, I found a little trick that keeps the session open, even if you forget to run a command as putty has a setting in the configuration that will work for us!
Open putty, then in the first interface "Session" Select connection type as "SSH", provide a hostname and port (or leave blank for default port).

After this, select the "Connection" category, then put a positive number of seconds, of course the number must be less than the time of an idle session.

You can now return to the category "Session" and record the session for later use.
That's all folks!
’)