Stop SSH from dropping your connection when you stop typing
SSH & Remote Administration
Stop SSH from dropping your connection when you stop typing
🧩 The Challenge
You finally get into a production box, start a long tail -f on a log file, and go grab a coffee, only to come back to a frozen terminal that eventually times out. It is infuriating to lose your session just because the network sat idle for a few minutes.
💡 The Fix
You can tell your local SSH client to poke the server every so often to keep the pipe open. It stops those annoying disconnects without needing to mess with the server’s own config.
ssh -o ServerAliveInterval=60 user@remote-host
⚙️ Why It Works
Adding this flag forces your client to send a null packet to the server if it hasn’t heard anything back for a minute. The server responds, the connection stays alive, and your session doesn’t get nuked by a firewall or router looking for an excuse to drop an idle state.
🚀 Pro-Tip: Add it to your ~/.ssh/config file under the specific host entry so you never have to type it again.
Linux Tips & Tricks | © ngelinux.com | 10/30/2026
