ssh Server unexpectedly closed network connection

i’m trying to connect to my digital ocean Ubuntu 16.04 server through ssh and sftp using putty and winscp. But i get the error “Server unexpectedly closed network connection”.

I do have access through the digital ocean control panel.

anyone knows what to do in a situation like this?

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.

I had same problem. I did :

cd /etc/ssh chmod 400 *

What In don’t understand is why those files were with wrong chmod. ???

@soerenfrisk @jtittle But if you have access to console and you’re migrating to a new server, can’t you just run the scp commands in the console and then kill off the old server?

Hi @soerenfrisk Maybe you accidentally activated the firewall or have a too hard configuration of IPS like fail2ban? If you run this command in the console, what does it tell you?

sudo ufw status numbered