PuTTY Network Error: Software caused connection abort

PuTTY Network Error: Software caused connection abort

Last updated on

Windows can trigger this error in PuTTY if it has given up on the machine at the other end of the connection. In this article we will configure PuTTY to attempt to keep idle connections alive.

TCP keepalives

Some network routers and firewalls need to keep track of all connections through them. Usually, these firewalls will assume a connection is dead if no data is transferred in either direction after a certain time interval. This can cause PuTTY sessions to be unexpectedly closed by the firewall if no traffic is seen in the session for some time.

To solve this issue, you can configure PuTTY to send null packets and TCP keepalives every few seconds.

Configure PuTTY

In the left-hand menu pane, select Connection

In the field beside Seconds between keepalives, enter 5.

Check Enable TCP Keepalives (SO_KEEPALIVE option)

Now click Open and leave the SSH connection idle for a while to see if it stays up. If you are using a PuTTY session profile, don’t forget to Save your profile with these new settings.

I’m Still Getting Disconnected!

Check for unreliable Internet connection

The problem may be an unreliable Internet connection. Monitoring your pings is a good way of determining if your connection is dropping packets and is to blame for PuTTY disconnecting.

Open Windows Command Prompt and run ping google.com -t (or the IP address of your remote server) and leave it running while you SSH connection is open. If you see even one Request timed out, this indicates a connectivity issue and may cause PuTTY to disconnect.

CMD Ping: Request Timed Out

You can also try some software that tests the uptime of an Internet connection. See: Internet Connectivity Monitor.

Try a different SSH client

Try using a different SSH client like (http://kitty.9bis.net) and see if the problem happens on that as well. If it does, you can isolate the problem away from PuTTY.

Keepalives are not always helpful..

Keepalives help if you have a firewall which drops your connection after an idle period; but if the network between you and the server suffers from breaks in connectivity then keepalives can actually make things worse. If a session is idle, and connectivity is temporarily lost between the endpoints, but the connectivity is restored before either side tries to send anything, then there will be no problem – neither endpoint will notice that anything was wrong.

However, if one side does send something during the break, it will repeatedly try to re-send, and eventually give up and abandon the connection. Then when connectivity is restored, the other side will find that the first side doesn’t believe there is an open connection any more.

Keepalives can make this sort of problem worse, because they increase the probability that PuTTY will attempt to send data during a break in connectivity. (Other types of periodic network activity can cause this behaviour; in particular, SSH-2 re-keys can have this effect. Therefore, you might find that keepalives help connection loss, or you might find they make it worse, depending on what kind of network problems you have between you and the server.

Found a Solution Yet?

Let us all know in the comments as this appears to be quite an elusive problem for many!

While You’re Here..

Sick of entering your Linux password every time you log in via PuTTY? See:

Make sure to keep your PuTTY settings backed up or copy them to another PC:

Did you know you can use PuTTY to set up a secure tunnel to your Linux box and then connect via VNC?

Let me know in the comments if this helped. Follow me on Twitter, Facebook and YouTube.

p.s. I increased my AdSense revenue by 68% using AI 🤖. Read my Ezoic review to find out how.

1 Star2 Stars3 Stars4 Stars5 Stars 4.17 (30 votes)

Leave a Reply

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

We use Markdown to style comments, like on Github and Reddit.
To do a line break, type two spaces after the sentence.
You can add inline code by wrapping it in backticks: `code here`

    To do an entire block of code  
    type four spaces before the line
    and it will appear in a block like this.
    <-- four empty spaces

12 replies

Came across this whilst looking for a solution myself, as this was occuring when i tried to connect to a raspberry pi.
I did the following that seems to have cured it .. well it did for me!.
1. Open cmd box
2. sudo rm -r /etc/ssh/ssh*key
3. sudo dpkg-reconfigure openssh-server

Once done started PuTTy on window PC and hey presto connection immediately.