← sources

How do you notice a host froze halfway through a long SSH command?

source: reddit (reddit:sysadmin)published 2026-10-26 20:57ingested 2026-10-27 02:39

retained text

`ssh` sends no keepalives of its own by default (`ServerAliveInterval 0`), and Linux waits two idle hours before the first TCP probe, so a script on a frozen host can hang for hours. Set the interval to 15 and a 45-second network blip kills the session. Do you tune keepalives, run commands detached and poll, or wrap them in `timeout`?

document fetched 2026-10-27 00:38 · canonical https://reddit.com/r/sysadmin/comments/1xg8z84/how_do_you_notice_a_host_froze_halfway_through_a