Prevent SFTP from disconnecting












4















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?










share|improve this question























  • 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
















4















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?










share|improve this question























  • 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














4












4








4


1






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?










share|improve this question














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?







server ssh sftp






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 2 '15 at 22:46









vaindilvaindil

2383618




2383618













  • 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



















  • 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

















What SFTP server software are you using?

– Fabby
May 18 '15 at 20:41





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





@Fabby OpenSSH_6.6.1p1 Ubuntu-2ubuntu2, OpenSSL 1.0.1f 6 Jan 2014

– vaindil
May 18 '15 at 21:30










1 Answer
1






active

oldest

votes


















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.






share|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








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f568219%2fprevent-sftp-from-disconnecting%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









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.






share|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


















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.






share|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
















0












0








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.






share|improve this answer













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.







share|improve this answer












share|improve this answer



share|improve this answer










answered May 19 '15 at 13:45









tomodachitomodachi

9,12042240




9,12042240








  • 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
















  • 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










1




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







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




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





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







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




















draft saved

draft discarded




















































Thanks for contributing an answer to Ask Ubuntu!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f568219%2fprevent-sftp-from-disconnecting%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Human spaceflight

Can not write log (Is /dev/pts mounted?) - openpty in Ubuntu-on-Windows?

張江高科駅