• Skip to main content
  • Skip to primary sidebar

Technical Notes Of
Ehi Kioya

Technical Notes Of Ehi Kioya

  • Forums
  • About
  • Contact
MENUMENU
  • Blog Home
  • AWS, Azure, Cloud
  • Backend (Server-Side)
  • Frontend (Client-Side)
  • SharePoint
  • Tools & Resources
    • CM/IN Ruler
    • URL Decoder
    • Text Hasher
    • Word Count
    • IP Lookup
  • Linux & Servers
  • Zero Code Tech
  • WordPress
  • Musings
  • More
    Categories
    • Cloud
    • Server-Side
    • Front-End
    • SharePoint
    • Tools
    • Linux
    • Zero Code
    • WordPress
    • Musings
Home » Zero Code Tech » How To Ensure Your PuTTY Session Never Times Out

How To Ensure Your PuTTY Session Never Times Out

March 19, 2019 by Ehi Kioya Leave a Comment

If you work on remote Linux servers often, then you’re probably already familiar with PuTTY.

PuTTY is a free terminal emulator, network file transfer application, and serial console for the Windows platform. Offering support for many different network protocols, like SSH, SCP, Telnet, raw socket connection, and rlogin, it is one of the most popular Windows connection clients. It is developed as open-source software by a group of volunteers.

The Problem

By default, PuTTY sessions are not configured to “stay/keep alive” (more on that below). And SSH servers usually have a timeout value.
 
So, when you SSH into a server via PuTTY and are inactive for a while, if your period of inactivity exceeds the SSH sever’s timeout value, your PuTTY session will automatically end without your knowledge.

When you eventually return to PuTTY and try to execute a command, you will be greeted with the following error message:

Network error: Software caused connection abort

Now, you have to login again and make sure you remain active. Otherwise, there will be another timeout.

This is annoying!

Yes, you could technically tweak your SSH server to never timeout. But why change a server-wide setting like that for just one client? And those server settings are usually quite complicated. Trust me.

Besides, in most cases, as a client, you probably don’t have the permissions needed to tweak SSH server settings.

A much better option would be to have PuTTY somehow figure it out.

How To Make Sure Your PuTTY Session Never Times Out

The idea behind the following solution is to make PuTTY keep sending null packets (called “keepalives”) to the remote server, tricking the server into thinking that the session is alive, forcing it to keep the connection open.

Step 1: Create A Session Profile

Create a PuTTY session profile like you normally would. I’m not bothering to go into the details of that here. The most important fields are Host Name (or IP address), Port, and Connection Type. Save your new session.

Step 2: Configure The Session Profile With “KeepAlives”

With your new session loaded, click Connection on the left side pane and you will see a screen like this:

PuTTY KeepAlives

Notice the field labelled Seconds between keepalives (0 to turn off).

Change this value to some other value. 10 or 15 should be okay. This value represents the time interval between two null packets sent to the remote server to keep the session alive.

The assumption here (and a reasonable assumption too) is that your SSH server can stay idle for more than 10 or 15 seconds without timing out (some servers may use a default timeout as low as 5 seconds or as high as 2 hours).

If your session continues to timeout after setting PuTTY keepalives to say 15 seconds, set the value to a lower number.

Step 3: Save The Session Profile

On the left pane, click on Session. This action takes you back to the window in Step 1.

Assuming you’re already working with a named, saved, and loaded session, just press Save again to save your keepalive setting to this session.

You should be ready to go now.

To access the profile in the future and make use of it without unnecessary timeouts, select the session you’ve just created in the “Saved Sessions” list and click Open.

Found this article valuable? Want to show your appreciation? Here are some options:

  1. Spread the word! Use these buttons to share this link on your favorite social media sites.
  2. Help me share this on . . .

    • Facebook
    • Twitter
    • LinkedIn
    • Reddit
    • Tumblr
    • Pinterest
    • Pocket
    • Telegram
    • WhatsApp
    • Skype
  3. Sign up to join my audience and receive email notifications when I publish new content.
  4. Contribute by adding a comment using the comments section below.
  5. Follow me on Twitter, LinkedIn, and Facebook.

Related

Filed Under: Linux & Servers, Zero Code Tech Tagged With: Linux, PuTTY, Server, Windows

About Ehi Kioya

I am a Toronto-based Software Engineer. I run this website as part hobby and part business.

To share your thoughts or get help with any of my posts, please drop a comment at the appropriate link.

You can contact me using the form on this page. I'm also on Twitter, LinkedIn, and Facebook.

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

26,223
Followers
Follow
30,000
Connections
Connect
14,641
Page Fans
Like

POPULAR   FORUM   TOPICS

  • How to find the title of a song without knowing the lyrics
  • Welcome Message
  • How To Change Or Remove The WordPress Login Error Message
  • The Art of Exploratory Data Analysis (Part 1)
  • Getting Started with SQL: A Beginners Guide to Databases
  • Replacing The Default SQLite Database With PostgreSQL In Django
  • Understanding Routes In Laravel
  • Building A Blog With Laravel – Part 6: Creating A Form For New Posts
  • Getting Started With JupyterLab
  • How To Become A Self-taught Programmer
  • Recently   Popular   Posts   &   Pages
  • Actual Size Online Ruler Actual Size Online Ruler
    I created this page to measure your screen resolution and produce an online ruler of actual size. It's powered with JavaScript and HTML5.
  • Allowing Multiple RDP Sessions In Windows 10 Using The RDP Wrapper Library Allowing Multiple RDP Sessions In Windows 10 Using The RDP Wrapper Library
    This article explains how to bypass the single user remote desktop connection restriction on Windows 10 by using the RDP wrapper library.
  • WordPress Password Hash Generator WordPress Password Hash Generator
    With this WordPress Password Hash Generator, you can convert a password to its hash, and then set a new password directly in the database.
  • Forums
  • About
  • Contact

© 2021   ·   Ehi Kioya   ·   All Rights Reserved
Privacy Policy