4

I have a problem with an SSH session freezing after using it again when it was idle for a while.

The problem is that the session doesn't freeze immediately, I can still use it. But as soon as a command sends more data, it freezes before any output arrives, and I have to restart the terminal.

If have read earlier solutions about MTU, but there, the session freezes everytime. Here it only happens after a period of inactivity.

Note that I have set ServerAliveInterval 120 in .ssh/ssh_config

Any clues about how I can solve this?

Ikke
  • 271
  • 1
  • 3
  • 15

3 Answers3

3

Suggestions:

  • Try setting the ServerAliveInterval, ServerAliveCountMax, and TCPKeepAlive options on the command line instead of through ssh_config, to rule out that there is a problem reading your settings. Perhaps the ssh_config should be called just config instead?
  • Use the verbose flag (more than once) to increase chances of an explanatory error message
  • Make sure the ServerAliveInterval * ServerAliveCountMax is less than the firewall's idle time threshold before tearing down your ssh session (ask your network admin).
  • If the server is yours, you could try the ClientAlive*-options there.
  • Check for version incompatibilities if not OpenSSH on both client+server.
MattBianco
  • 3,704
3

Change ~/.ssh/ssh_config to ~/.ssh/config. Make sure the permissions on it are 700.

This discussion has a lot of good information. You can also follow the tag for ssh (just click on /ssh under your question) to go to a tag wiki for more information and trouble shooting guidance.

George M
  • 13,959
  • 1
    I had named it wrong. After renaming it, I (so far) didn't have any freezes anymore. – Ikke Jul 04 '12 at 14:29
0

you can set up your client to send the tcp keep alive messages. I know it is under the connection options in putty. Not sure on the command line options but this solved it for me when I was having problems. Though it only did it to me on the win7 machines at school.

Joe
  • 1,306