10

Apologies if this is not the right place for asking this question.

I regularly need to ssh to different servers. Now, from my home machine (linux mint), when I connect via ssh, after some time of inactivity, my ssh shell freezes, and there's no way to get it back. The only thing I can do is '~.", that at least gives me my initiating shell back.

When I login from other locations to the same servers there's no issue. Could that be a problem with my ISP? How can I investigate further on this one?

It's really annoying, as I have to re-establish ssh connections after the freeze, navigate back to where I was and resume work. Thanks

  • Do you have a static IP address ? If not it could be that your ISP has given you a different IP address mid session - check your logs and see. – user9517 Feb 12 '14 at 18:00
  • I don't have a static IP address. Will check – Fabio Feb 12 '14 at 18:09
19

Your NAT is dropping your TCP socket after a period of inactivity.

Your ssh client can optionally send periodic noops to the server, thereby eliminating this problem. To do this, add this to your ~/.ssh/config:

Host *
  ServerAliveInterval 60

Alternatively, re-configure your NAT to not expire items out of its state table as quickly as it is now.


In addition to the above, you should be using a terminal multiplexer for your sessions - something like GNU Screen or tmux. With either of those, you can recover your session in the event of getting disconnected.

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.