SSH randomly hanging (when not on local network)

Hi all,

We are experiencing a rather odd issue with SSH access to our opensuse linux server. When accessing it via SSH on the local network everything works fine and there are no issues. However, when accessing it via SSH from an external location it hangs randomly.

We can log in without issue and some commands seem to work ok. If we attempt to run a command such as “top” the SSH session simply hangs permanently. using “strace” the process hangs at different points so it is not a particular part of it’s execution that appears to be the problem.

Does anyone have any ideas why this would happen? Thanks in advance.

This can happen when the line is bad and the daemon terminates the connection. See man sshd_config and check the settings in /etc/ssh/sshd_config.

This helped in my case:

ClientAliveInterval 30 
ClientAliveCountMax 360

You can also try to set

TCPKeepAlive no

and see if this helps.