If your shell disconnects after a while, re-log in then enter
$ env | grep TMOUT
If TMOUT is set to non-zero, the session will be disconnected after the number of seconds that TMOUT is set to. If this is an issue, increase TMOUT or set it to zero.
But sometimes you don't have this control over timeouts...idle TCP connections may be configured to drop at the router or firewall level. If you don't have control over those devices, it may be necessary to configure TCP keepalive.
This syntax is for Linux, your OS will be different. Add lines to /etc/sysctl.conf:
net.ipv4.tcp_keepalive_time = 600
net.ipv4.tcp_keepalive_intvl = 60
net.ipv4.tcp_keepalive_probes = 20
then type in
sysctl -p
to get the new values to take effect. The 600 means that keepalive will kick in when the connection has been idle for 10 minutes (600 seconds).

0 comments:
Post a Comment