Ssh and NAT disconnects

From Fratm.com

Jump to: navigation, search

SSH disconnects when behind NAT


This is usually the result of a packet filter or NAT device timing out your TCP connection due to inactivity. You can enable ClientAliveInterval in the server's sshd_config, or enable ServerAliveInterval in the client's ssh_config (the latter is available in OpenSSH 3.8 and newer).

Enabling either option and setting the interval for less than the time it takes to time out your session will ensure that the connection is kept "fresh" in the device's connection table.

Here is what I use in my sshd_conf


# added 10/17/06  Possible fix for nat time out disconnects.
ClientAliveInterval  60
ClientAliveCountMax  30

Fratm 10:23, 17 October 2006 (PDT)

Personal tools