Kill that frozen SSH session without closing your terminal

SSH & Remote Administration

Kill that frozen SSH session without closing your terminal

🧩 The Challenge

You’re neck-deep in a config file on a remote server, something borks, and suddenly your SSH session is just… dead. Stuck. Ctrl+C does nothing. You’re staring at a frozen terminal, knowing you’ll have to close the tab and start over. Nobody tells you there’s a way out of this without nuking your whole terminal window, and yeah, I’ve absolutely wasted hours closing and reopening terminals because of this.

💡 The Fix

Turns out, there’s a hidden SSH escape sequence that’ll instantly kill the connection from your end. It’s like a secret backdoor to cleanly drop that bad session and get your shell back, no fuss.

(Hit Enter if your cursor isn't on a fresh line)
~.

⚙️ Why It Works

SSH clients actually interpret certain character sequences as commands for themselves, not the remote server. That tilde followed by a period is the ‘terminate connection’ signal, making your client drop the session without you having to pkill it or close the window.

🚀 Pro-Tip: Want to see all the available escapes? Try ~?.

Linux Tips & Tricks | © ngelinux.com | 10/31/2026

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted