Walker News

How To Keep Inactive SSH Session From Disconnected

For those who are particular about network security will never compromise to allow telnet protocol as part of the remote access implementation.

Beside network protocol consideration, network security experts also suggest configuring network routers to drop or disconnect an idle connection.
That was the problem what my colleague encountered this morning. When his Putty initiated SSH connection from outskirt to servers at HQ over VPN connection, with a not-so-good dial-up networking, the VPN router consistently disconnect / drop the SSH session whenever the idle threshold triggered.

However, some of the client software might able to overcome the restriction. For example, the Putty (wonderful Windows SSH client) offers keepalive option to get rid of “VPN router disconnects idle connection”!

Configure Putty keepalive option to get rid of VPN router auto disconnect idle or inactive SSH session.
  1. [ Optional, only applicable if you want to save a SSH profile for convenient ] Click on the Session category tree menu, enter Host name or IP address of target host, select SSH protocol and gives it a meaningful profile name in Saved Sessions text box.
     
  2. Click on the Connection category tree menu, enter a non-zero digit (indicates number of seconds) in Seconds between keepalives (0 to turn off) text box.
     
  3. Go back to Session category tree menu and click the Save button.
     
  4. From now onwards, whenever you load this SSH session profile and click Open button, the keepalive feature will be enabled to keep the inactive / idle SSH session from disconnected by VPN router (that enforce such rigid security practice).

So, if you’re using Putty as Windows SSH client and encounter problem of SSH disconnected after idle / inactive for some minutes, please try to configure the keepalive option.

Custom Search

  1. Yinon 18-02-09@17:26

    just run top or `cat -` ect.

  2. linux lover 06-08-09@18:04

    Hi, thanks for your tips.
    It help me much today. My putty connection was keep disconnecting, but after I configure the keep alive interval of 20 second, the connection is now stable.
    Thank you.

  3. Sree 01-07-10@18:12

    Hi,
    Please help me in the following issue. We are using VPN to connect to client’s network and using PUTTY we are running some ETL jobs on the AIX server. Whenever VPN disconnects, PUTTY session is becoming inactive and we are loosing the data.

    I have tried the above options, but no use in my case. So, is there anyway that I can keep the PUTTY session remains active even after reconnecting through VPN.

    Thanks in advance,

  4. aaa 01-07-10@20:10

    Hi, thanks for your tips.
    It help me much today. My putty connection was keep disconnecting, but after I configure the keep alive interval of 20 second, the connection is now stable.
    Thank you.

  5. Walker 04-07-10@18:56

    @Sree, I think you should look at how to keep the VPN stability – if this VPN is so vulnerable, why you should rely on it?

    Alternative: is that possible to have client sites trigger Putty at remote host to run server-side jobs and then only stream the output back to clients?

  6. Sanjay 16-09-10@21:37

    Thanks a lot…
    It helped me to fix the issue of sessions terminated due to idle timeout..

  7. jojo 23-08-11@03:37

    thanks a lot – im relly getting tired of putty timeouts on this new system im on . .. youre the mac daddio

2014  •  Privacy Policy