|
Article ID: 238
Last updated: 22 Jul, 2020
Idle SSH Connections are Broken After 10-15 MinutesIf you find that idle SSH connections tend to be dropped after 10 to 15 minutes and your are using a router or other device that implements Network Address Translation (NAT), such as a DSL router, you may want to enable the ServerAliveInterval parameter in your ~/.ssh/config. The issue is that some devices that implement NAT will drop information from their state tables if a TCP connection has been idle for just a few minutes. In such cases, it may be necessary to ensure that the connection is never truly idle for an extended period. The ServerAliveInterval parameter (supported in OpenSSH 3.8 and later) causes the SSH client to periodically send an encrypted query to determine if the server is still responsive. The packets will make the connection appear to be active and can prevent the NAT state table entry for the connection from timing out. For example, adding the following to your ~/.ssh/config will cause an encrypted query to be sent every five minutes:
TIP: You may need to experiment with the length of the interval to determine an appropriate value to prevent your connection from being broken. If you use the NAS config template, ServerAliveInterval is set to 10 minutes.
SSH Connection is Periodically Broken Even When Connection is ActiveDuring an SSH session, the client and server will re-negotiate the keys used to encrypt the session every so often. Very old versions of OpenSSH did not implement this feature, which can cause a problem when connected to the SFEs. Your connection may appear to hang or may abort with an error message such as the following:
If you encounter this issue, you will need to upgrade to a newer version of OpenSSH. Note: Other implementations that were derived from the OpenSSH distribution, such as SUN Secure Shell, are likewise known to exhibit this problem. Slow Performance Transferring DataWhile OpenSSH performs reasonably for local data transfers, the performance will tend to be reduced due to the latency of long-haul network connections. Depending on the severity of the impact you may have several options to improve this situation. Upgrade to OpenSSH 4.7 or LaterIf you are using a version of OpenSSH that is older than 4.7, you may see an improvement in file transfer performance by upgrading to OpenSSH 4.7 or later. This is due to the use of a larger channel buffer introduced in that version. Read File Transfer Tips for more recommendations. |