SSH connections

Connection alive time

Check keep alive time settings; unit of first both returned values is seconds, a number of the third.

Commands to check keep alive connections
cat /proc/sys/net/ipv4/tcp_keepalive_time (1)
7200
cat /proc/sys/net/ipv4/tcp_keepalive_intvl (3)
75
cat /proc/sys/net/ipv4/tcp_keepalive_probes (2)
9
1 the keepalive routine waits for n seconds before sending the first keepalive probe …​
2 and than resend it every n seconds (interval)
3 number of non received ACK (acknowledge flags) responses after the connection is marked as broken

Editing the values (as root user)

Change keep alive values
echo 600 > /proc/sys/net/ipv4/tcp_keepalive_time
echo 60 > /proc/sys/net/ipv4/tcp_keepalive_intvl
echo 20 > /proc/sys/net/ipv4/tcp_keepalive_probes