Link to home
Start Free TrialLog in
Avatar of Iswar Sahu
Iswar Sahu

asked on

Putty issue with ssh to ubuntu server "Network error: Software caused connection abort"

I successfully connected to a remote ubuntu server from Putty client in my windows 10 desktop, but if putty terminal is idle for sometime (may be 1/2 minutes), then I am getting
"Network error: Software caused connection abort".

Any idea what could be the cause for this issue.

Note: I have tried setting up in etc/ssh/ssh_config file in ubuntu server with below values :
    ServerAliveInterval 60
    ServerAliveCountMax 120
But still getting the same error.
Avatar of Omar Soudani
Omar Soudani

-Start Putty
-Load your connection settings if you have them saved
-Click on “Connection”
-On the section that says "Sending of null packets to keep session active", Changed it to 5 seconds. 300 seconds may be better if network
  outages are your problem

Attached is a screen shot of the settings.
1O53M.png
Avatar of Iswar Sahu

ASKER

Thanks for your input.
I tried this option, but still getting the same issue and network outage is not my problem.

It looks like even though putty is not idle, after sometime of login to the ubuntu server it is automatically getting disconnected and getting the same error.
Read what PuTTY has to say about the error

This is a generic error produced by the Windows network code when it kills an established connection for some reason. For example, it might happen if you pull the network cable out of the back of an Ethernet-connected computer, or if Windows has any other similar reason to believe the entire network has become unreachable.

Windows also generates this error if it has given up on the machine at the other end of the connection responding to it. If the network between your client and server goes down and your client then tries to send some data, Windows will make several attempts to send the data and will then give up and kill the connection. In particular, this can occur even if you didn't type anything, if you are using SSH-2 and PuTTY attempts a key re-exchange.

(It can also occur if you are using keepalives in your connection. Other people have reported that keepalives fix this error for them. (There are pros and cons of keepalives.))

We are not aware of any reason why this error might occur that would represent a bug in PuTTY. The problem is between you, your Windows system, your network and the remote system.

Try a different SSH client

Most likely the problem exists somewhere between PuTTY and the target SSH server. To provide evidence for this, use a different SSH client like (http://kitty.9bis.net) and see if the problem happens on that as well. It probably will which will isolate the problem away from PuTTY.

Suspect spotty Internet connection

The problem may be the spotty Internet connection. Internet Connectivity Monitoring the uptime of an Internet connection is a good way of determining if your ISP are losing packets and is to blame for PuTTY going down. Get some software that tests the uptime of an Internet connection. For example, http://code.google.com/p/internetconnectivitymonitor/. Frequent and long disconnections from the Internet is a breach of ISP service requirements. If this is the case, it will be difficult to prove it's the ISP's fault, as tech support automatically blames these sorts of issues on your computer, OS, router, and wiring to your home. If you are using cable Internet and living out in the boonies, it could be possible that defective hardware in your neighbor's homes could be sending static on the line for a few seconds/minutes when they first turn it on. Finally, it's possible that there is defective hardware in the ISP's network to your home. The cost to ISPs to replace their hardware is so high, that often times they won't do it unless there are enough subscribers in an area to warrent the cost.

Suspect the wired/wireless router

Are you connecting through a wired/wireless router? How old is it? Your router might be the problem. Old wireless and wired technology can get old and drop connections sporadically and restart them, causing PuTTY to die. Remove these components from the equation and see if that solves the problem. Try a wired connection and/or different router to see if that fixes the problem. I had a Linksys wireless router suffer this slow death and drop connections and restart them.

Suspect the operating system providing the SSH connection

The computer you are connecting to with SSH has a policy for number of seconds to keep SSH connections alive. This number is set low for security reasons, and you could increase it. Where this setting is depends on what operating system you are using that provides SSH.

If you are using PuTTY through a virtual machine

If you are using PuTTY passing through a virtual machine, there may be a policy on the virtual machine which is breaking your SSH connection to the server when it thinks it is inactive. Increasing these values depends on which virtual machine software and operating system you are using.

If the Internet connection is bad, SSH client connection workarounds:

If your ISP provides an unstable connection then you could make the disconnections less painful with "ssh autologin". What you do is generate a public and private key. And you tell your foreign server to automatically let in anyone who provides an accurate private key. It doesn't solve your problem completely, but when the Internet outage happens, all you do is close the window, double click an icon, and you are immediately taken back to your home folder command line without entering a username/password.
ASKER CERTIFIED SOLUTION
Avatar of Dr. Klahn
Dr. Klahn

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you so much, it solved the issue.
The solution was very helpful.
Glad to help.