5

I am using the latest version of FileZilla (3.9.0.6) to connect to a fully up-to-date Ubuntu Server 14.10 with OpenSSH. When I SSH into the server using PuTTY, the connection never times out. I stay connected indefinitely and am not disconnected. When I SFTP in, however, I am disconnected after roughly five minutes or so of no activity. The specific message is Disconnected from server.

The guides I have found (1 and 2, among others) say to add ServerAliveInterval 60 to /etc/ssh/ssh_config or to add ClientAliveInterval 60 to /etc/ssh/sshd_config. I tried both of these but neither has worked--I still receive the "Disconnected from server" message.

FileZilla has an option to keep FTP connections alive, and that would make things simple, but a) that option is in the FTP section (not the SFTP section), and b) directly underneath the option it says that proper servers do not require that option to be set and to contact the server admin if the option is necessary.

What do I need to do to set my server so that SFTP connections are indefinitely kept alive?

  • What SFTP server software are you using? – Fabby May 18 '15 at 20:41
  • @Fabby OpenSSH_6.6.1p1 Ubuntu-2ubuntu2, OpenSSL 1.0.1f 6 Jan 2014 – vaindil May 18 '15 at 21:30
0

The sftp protocol does have a keep alive features but they are not exposed in the filezilla client.

Still I don't believe such a setting should be necessary. I'm failing to reproduce your problem. I have had a Filezilla connection open to my Ubuntu ssh server for over 20 hours without any disconnects.

So I believe that problem is network related. Do you connect to this machine through a firewall/ wobbly wifi? or has the machine got some kind of packet filtering software installed and configured like iptables or fail2ban

It's seems more probable that this is the reason for your disconnects.

| improve this answer | |
  • 1
    I've had this problem ever since I started using Ubuntu VPSes. I've been on numerous different connections since I've been at college for the past several years, and I've only ever used SFTP to connect. I've been wired at five separate locations with two different computers each, wireless at three locations with two different computers than the wired ones, I've used (at least) 3 servers running the latest versions of OpenSSH (Ubuntu 14.04, 14.10, 15.04), and this problem has occurred on every single combination of the above. – vaindil May 19 '15 at 18:39
  • 1
    You mention that its a VPS. Since you change networks on the client and still have the same issues. It clearly seems to be a problem in your hosting providers end. Possibly closing TCP connections to conserve resources in their firewall. – tomodachi May 20 '15 at 11:25
  • Ah, that makes sense. I have used two different VPS providers and the issue has occurred on both; when I have some time tonight I can spin up a local Ubuntu VM and try that. I'll let you know. – vaindil May 20 '15 at 12:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.