Keep your SSH sessions alive when your home internet flutters

SSH & Remote Administration

Keep your SSH sessions alive when your home internet flutters

🧩 The Challenge

Dealing with a frozen terminal because your router decided to hiccup or the coffee shop Wi-Fi refreshed is the absolute worst. You end up mashing Control+C for five minutes waiting for the connection to finally drop so you can log back in.

💡 The Fix

Just tell your local SSH client to poke the server every now and then so the connection doesn’t go stale. It keeps the pipe open and prevents those annoying ghost sessions from hanging around.

echo "ServerAliveInterval 60" >> ~/.ssh/config

⚙️ Why It Works

Setting this interval forces the client to send a null packet to the server if nothing else is happening, ensuring your firewall or router doesn’t get trigger-happy and kill the idle session.

🚀 Pro-Tip: Add “ServerAliveCountMax 3” to the same config file to give it a bit more grace before it finally decides to give up on a dead link.

Linux Tips & Tricks | © ngelinux.com | 9/11/2026

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted