SSH freezing after inactivity
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.
open /etc/ssh/sshd_config
uncomment and set the following to :
ClientAliveInterval 10
ClientAliveCountMax 6
save the file and restart ssh.