Don’t lose your work when the SSH connection blips
SSH & Remote Administration
Don’t lose your work when the SSH connection blips
🧩 The Challenge
Everyone has had that moment where your Wi-Fi flickers or you close your laptop lid and suddenly your terminal session is frozen and unresponsive. You lose all your unsaved work in that vim buffer or the state of your mid-command output because the pipe just died.
💡 The Fix
Use mosh instead of standard SSH for those shaky remote connections. It handles intermittent roaming and packet loss like a champ, keeping your session alive even when you hop between networks or your connection hits a dead zone.
mosh user@remote-server
⚙️ Why It Works
Unlike SSH, which relies on a fragile TCP stream, mosh uses UDP and its own synchronization protocol to keep your session state intact regardless of IP address changes or temporary outages. You’ll never have to re-login to a stalled session again.
🚀 Pro-Tip: Keep an SSH alias for your main box and just swap mosh for ssh in your config—it works seamlessly with existing keys.
Linux Tips & Tricks | © ngelinux.com | 9/16/2026
