How to Fix PuTTY Error "Remote Side Unexpectedly Closed Network Connection"?
🌟What Does the PuTTY Error Mean?
When you see the error message resembling ‘putty remote side unexpectedly closed network connection’ it simply means the server has shut down your SSH connection unexpectedly, unceremoniously kicking you off the servers.
This PuTTY fatal error is the most common type of error, and with many different potential causes and also solutions you can try to get your connection going again.
Possible Causes for This PuTTY Fatal Error
There are various reasons why a server can be triggered to terminate an SSH connection and unceremoniously boot a user off the network. Some of the most suspect of these include:
Network issues
An unstable network or intermittent connectivity issues can cause a server to unceremoniously kick you off. Severe delays in data transmission between PuTTY and the server can also cause the ‘putty network error connection timed out’ error message.
Firewall restrictions
There could be a firewall in your device or on the server side blocking your connection due to timeout settings on idle connections, limits on simultaneous connections from the same IP or to a specific port, or suspicion of abnormal or malicious behavior.
Inactivity timeout
The host servers can have instructions to terminate PUTTY sessions that remain idle for a certain period. You can fix this by enabling PUTTY keepAlive.
Server-side issues
The fatal PuTTY error can also occur due to issues on the server side. These include the aforementioned firewalls and security software configurations, inactivity timeout settings, server load/resource issues, and incorrect SSH settings.
Common Troubleshooting Steps
Before we jump into the specifics, here is a breakdown of some general troubleshooting tips for this fatal PuTTY error.
- Retry the connection. In some cases, especially when dealing with temporary glitches, a simple reboot of the connecting device resolves matters.
- Check the network connectivity. You want to ensure a stable internet connection without intermittent drops.
- Check server load ,i.e., CPU and memory usage, to ensure your server is not running out of resources.
- Inspect SSH logs. Give the SSH server logs a look-see to determine the cause of the connectivity issues (/var/log/auth.log, for Linux users)
- Verify login details. Check that you are entering the correct credentials.
- Update PuTTY: Get the latest versions of both PuTTY and the remote server software to prevent issues due to bugs, incompatibility, and security loopholes.
Advanced Settings: Step-by-step Guide
Enable KeepAlive
To fix the PuTTY connection timeout issue, you can configure your PuTTY software to enable TCP keepalives. And also send periodic "null packets" to the server every few seconds, so the server considers the connection active even when you are doing nothing.
To enable putty to keep alive follow these steps.
- Open PuTTY and go to connections, then look for the setting that says ‘Sending null packages to keep the session active.’ Increase the seconds between keepalives value from 0 to 30 or 60 seconds.
- Tick the box that says ‘Enable TCP keepalives’ then close the menu.
Review Firewall and Security Software Settings
As mentioned, an SSH server can terminate connections due to various firewall and security software issues ranging from timeouts to suspicious behavior and limits on the number of connections allowed. Check firewalls and security software on your end and the server to see if any of the above issues could be to blame.
- Ensure that the firewalls and security software are configured to allow SSH traffic (i.e., access via port 22) without overly restrictive rules.
- Adjust idle timeout settings on firewalls.
- Whitelist specific trusted IP addresses to prevent the server from mistakenly blocking connections from these known sources.
- Monitor IDS/IPS alerts, as well as firewalls and security software logs, to identify and address any issues causing this fatal SSH connection error.
- Update and patch firewall and security software regularly to ensure the software performs efficiently without overreacting to certain behaviors in the traffic.
Increase Server Timeout Settings
To adjust SSH configuration to increase server timeout settings, you’ll need to gain root access to the server.
- Open the SSH configuration file using nano or vim editor and navigate to the /etc/ssh/sshd_config file.
- In the configuration locate the lines with these keywords: ClientAliveInterval and ClientAliveCountM. If these lines are preceded by the ‘#', ensure to uncomment them then edit the values assigned to the keywords.
- The ClientAliveIntervals allows you to specify the periods you will receive null packets from the server to keep the connection alive whereas ClientAliveCountMax allows you to specify the number of times the server will contact your machine without receiving a response before terminating the session.
- For example, if you use ClientAliveInterval 30 and ClientAliveCountMax 4, the server will contact your machine 4 times in 30-second intervals (i.e a 120-second timeout) before terminating the session in case it doesn’t get a response.
- Reload the daemon so the changes can take effect.
sudo nano /etc/ssh/sshd_config;
ClientAliveInterval
ClientAliveCountMax
sudo systemctl reload sshd
Other PuTTY Settings
- Verify that your SSH protocol settings, encryption algorithms, and key exchange methods between PuTTY and the SSH server are compatible. If not, adjust them accordingly.
- Identify and disable [problematic PuTTY plugins and extensions
Alternative Solutions to Try
SSH Clients Alternative
While PuTTY is a popular remote access tool, you can always try other options if you keep hitting your head against the wall with the above fixes. We are talking about free or premium SSH clients such as OpenSSH, Terminus, and SecureCRT that allow you to connect to remote servers and also enjoy additional features like session management and multi-factor authentication to prevent errors such as the server abruptly terminating the session.
Best Hassle-free Remote Access Tool
Alternatively, if you are looking for tools that don't require you to do command line stuff, you can try remote access solutions such as our very own AirDroid Remote Support App.
AirDroid Remote support is a lightweight remote access tool for IT professionals and individuals looking for the ability to remotely access, troubleshoot, and control several devices from anywhere anytime. It's the perfect app for remote work setup management, IT support, or after-hours server maintenance tasks.
Why choose AirDroid over PuTTY?
- Connect and control Windows devices from your PC.
- Doesn't require you to do any command line stuff to gain remote access.
- Advanced data encryption algorithms and black screen mode.
- Engage with users through real-time voice chat, messaging, file transfer, screen mirroring.
FAQs
What does “putty fatal error connection timed out” mean?
The fatal error “connection timed out” is sent by the remote server when it detects periods of inactivity from the client machine. Usually, servers are configured to contact the client machine periodically say (30 seconds) a given number of times e.g. 4 attempts. If the server doesn’t receive a response after the 4 attempts, it terminates the PuTTY session. The surest way to prevent this is to configure PUTTY to send null packets even when one is not doing anything.
Can I prevent this error from happening again?
One of the most common questions about the fatal PuTTY error is how to prevent it from ever happening again. Well, while one cannot always avoid the error, because some circumstances may be out of one’s control, the above-mentioned solutions are enough to reduce the frequency of occurrence.
When should I contact the server administrator?
When you encounter the above fatal PuTTY error, your immediate reaction may be to reach out to the server admin. However, in some cases, the issues can be a simple matter of incorrect credentials, timeout configurations, or unstable internet connection. Always try troubleshooting the problem yourself before contacting professionals in case you keep hitting your head against the wall.
Final thoughts
To put it quite frankly, the PuTTY fatal error "Remote side unexpectedly closed network connection" is one of the most unavoidable inconveniences when SSHing to a remote server. It happens if the server unexpectedly closed network connection. The good news is that the above-mentioned troubleshooting steps have already proven effective for many users all over the world so there’s no need to panic when the message pops on your screen. Alternatively, you can try out other solutions like our AirDroid application which allows no-coding access to remote devices running on both Windows and desktop.
Leave a Reply.