Question

Why does my SFTP connection keep disconnecting every 5 minutes? Network error: Software caused connection abort

Posted April 7, 2016 6.9k views
Ubuntu Networking

I made a new droplet today (Ubuntu 14.04 LAMP image) and I’m having some trouble with my SFTP connections. Whenever I connect via SFTP (using root) I always get disconnected after about 5 minutes of inactivity. The client becomes unresponsive for around 15 seconds and shows this error:

Network error: Software caused connection abort

This happens on both WinSCP and FileZilla with the exact same error message. I have not edited any configuration files on the droplet or installed anything else apart from phpmyadmin.

How can I stop my SFTP sessions from disconnecting so often?

Tried adding “ServerAliveInterval 60” to ssh_config and restarted the ssh service but it didn’t make any difference

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.

1 answer

I’ve fixed this by adding:

ClientAliveInterval 60 to etc/ssh/sshdconfig
ServerAliveInterval 60 to etc/ssh/ssh
config

Then restarting the ssh service. SFTP sessions are no longer timing out.

Submit an Answer