By Ellie / Last Updated May 17, 2023

PuTTY Fatal Error: Remote side unexpectedly closed network connection

“I'm using PuTTY to connect to our server via SSH and immediately receive the following error: Remote side unexpectedly closed network connection. What should I do?”

-Question from StackExchange

Putty Fatal Error

How to fix the “Remote side unexpectedly closed network connection”error

When remotely SSH into a server using PuTTY, you may fail and receive the “Remote side unexpectedly closed network connection” error. This is because if a PuTTY session is left idle, it will disconnect at a time set by the host server.

How can you fix the Remote side unexpectedly closed network connection PuTTY? The PuTTY client can be set to connect always and not time out due to inactivity. All you have to do is enable keep-alive in PuTTY. This instructs PuTTY to periodically send null SSH packets to the remote host, preventing the session from timeout.

Step 1. Open PuTTY on the client.

Step 2. Select the Session item. Enter session details such as Hostname or IP Address (e.g., "destination.ipaddress.here.com" or "192.168.1.1").

Step 3. In the Saved Sessions text-entry box, provide a name for the session (e.g., “savedsession”). Select Save.

Saved Session

Step 4. Choose the Connection option. Change the default value of Seconds between keepalives from 0 (off) to 1800 (30 minutes).

Step5. Check the Enable TCP keepalives (SO KEEPALIVE option).

Putty Connection

Note: There are also three things you need to check if you still got the error after configuring the above steps:

  • If the firewall were to block the connection, it would time out. Make sure the firewall is turned off.
  • If the port forwarding is not set up correctly, for example, if you specify the wrong port, it would time out.
  • If you connect to the wrong hostname or IP address, it would time out.

A GUI alternative to PuTTY: Access a remote server securely and easily

PuTTY allows you to remotely connect to a server via SSH using commands. However, for users who are not very skilled at commands, using PuTTY is a little bit challenging. Therefore, we would like to recommend you a more intuitive and easy way to achieve remote access. AnyViewer, the free remote access software for Windows, provides you with a GUI experience and employed ECC end-to-end encryption, helping you achieve secure remote access with ease.

Besides, it is provided by a strong technical team, helping you complete a stable and fast remote connection. You’ll seldom experience a connection broken down with AnyViewer.

Download Freeware Win PCs & Servers
Secure Download

Step 1. On both computers, download, install, and launch AnyViewer. Go to Log in on the Controller computer, and then click Sign up (if you have already signed up on its official website, you can log in directly).

Log in AnyViewer

Step 2. Fill out the signup form and you should now see that you have successfully logged into AnyViewer. Your device will be assigned to the account to which you have logged in automatically.

Free Editions

Step 3. Sign in with the same AnyViewer account on another device. On your local device, go to Device, click the remote computer,  then click the One-click control for unattended remote access.

Connect to My Devices

The remote desktop will appear once the connection is established. After that, you have complete control over it.

✍ It is recommended to upgrade your account to a Professional or Enterprise plan and see what a professional or enterprise plan can bring you:
Assign more devices:  More devices can be assigned to the same account for one-click remote access. 
Connect in privacy mode: Check Connect in privacy mode and you can control the remtoe computer with blacking the screen and disable the remote keyboard and mouse click.
Control more computers: You can control more computers from one computer at the same time. 
Faster file transfer: File transfer speed will be increased. Transfer speed is 500 KB/s for a free account and up to 10 MB/s for a paid account.
...

 

Closing words

This post primarily introduces how to fix the “Remote side unexpectedly closed network connection” SSH error. The solution is to enable keep-alive in PuTTY. The detailed steps are listed above. If you have encountered this problem, follow the steps to troubleshoot it.

Besides, we also recommend AnyViewer to you. It is a free remote desktop software for Windows. With it, you can easily access a remote server without a connection breakdown.