PuTTY gives "Server unexpectedly closed network connection ....why?

When i am connecting digital ocean server using putty i am getting error like server unexpectedly closed network connection. How can i solve this . Plz help.

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.


You may want to try enabling TCP Keepalives under the Connection menu for PuTTy. Start by loading your profile, navigating to the Connection menu on the left side, and under Low-level TCP, click on “Enable TCP Keepalives.”

You’ll also need to adjust the first option, the “Sending of null packets to keep session active.”

Try changing that to 10, 20, or 30 (which is in seconds).

For the changes to stick, you’ll need to save your profile once these changes have been made, else you’ll have to do this before you attempt to login each time.

What IP and port are you using? Did you try using the console in your DO panel?