SSH & Remote Administration
Stop SSH from bouncing you off the server because your connection went idle
🧩 The Challenge
Dealing with a production jump host that drops your session every ten minutes because of some overzealous firewall timeout is infuriating. I’ve lost count of how many times I’ve had to re-authenticate during a mid-deployment debugging session.
💡 The Fix
Tell your local client to send little heartbeat signals to the server, which keeps the connection alive even when you are just staring at the screen thinking. It’s a simple config tweak that keeps your session rock solid.
echo "ServerAliveInterval 60" >> ~/.ssh/config
⚙️ Why It Works
Setting this interval forces your client to send a null packet to the server every minute, effectively tricking any middle-man firewalls into thinking the connection is still active.
🚀 Pro-Tip: Add ServerAliveCountMax 3 to the same config block so your terminal actually gives up if the network truly dies.
Linux Tips & Tricks | © ngelinux.com | 8/6/2026
