Sftp connection break on Gedit and Nautilus

asked 2015-06-03 15:39:04 -0600

ggsalas gravatar image

Hi, I use Gnome Gedit to edit php and css files on my sftp server. Do you know how to avoid that the sftp connection break?

Best regards, Gabriel

edit retag flag offensive close merge delete


Can you give an example? How often does it happen? Are you doing anything special for the connection to break etc?

bit4man gravatar imagebit4man ( 2015-06-05 23:08:11 -0600 )edit

Hi @bit4man I connect to a ssh with nautilus, then I open a php file with gedit. After a while I can't save. If I reconnect on nautilus I can save again

ggsalas gravatar imageggsalas ( 2015-06-06 10:01:11 -0600 )edit

Check your ssh connection timeout. Servers and routers will automatically terminate sessions if they are idle too long. You can partly fix it by setting the TCPKeepAlive in the sshd_config file, and if your router/NAT is the one messing with the connection, you may tweak the ClientAliveInterval etc. parameters too. This all assumes you have access to the server. If you don't, a "cheap" solution is to have a simple cron job that every 5 minutes or so sends a small file to the host, and then delete it again :)

bit4man gravatar imagebit4man ( 2015-06-06 12:09:11 -0600 )edit

Hi @bit4man I edited the file /etc/ssh/sshd_config and uncomment TCPKeepAlive yes. Now I not receive error message, but after a while Gedit can't save (takes infinite time trying save the file).

ggsalas gravatar imageggsalas ( 2015-06-06 13:30:12 -0600 )edit