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?
3 Answers 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.
-
1I had named it wrong. After renaming it, I (so far) didn't have any freezes anymore.Ikke– Ikke2012年07月04日 14:29:23 +00:00Commented Jul 4, 2012 at 14:29
Suggestions:
- Try setting the
ServerAliveInterval
,ServerAliveCountMax
, andTCPKeepAlive
options on the command line instead of throughssh_config
, to rule out that there is a problem reading your settings. Perhaps thessh_config
should be called justconfig
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.
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.
man ssh_config
.