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
