On the impossibility to use escape sequences when the networks hangs
openssh at tr.id.au
openssh at tr.id.au
Tue Oct 14 11:28:21 AEDT 2025
> > In short: how does one control an interactive connection that
> > currently is incapable to send/receive data? ssh just hangs.
>
>
> What happens if you try :
>
> $ ssh -e\^ -l someusername remotehost
>
> I use that sort of thing all the time. The manpage says :
>
> -e escape_char
> Set the escape character for sessions with a pty (default: '~').
> The escape character is only recognized at the beginning of a
> line. ... <snip>
I believe it's easy to overlook/forget the requirement: "The escape character is only recognized at the beginning of a line."
I suppose using this sequence would solve the OP's issue: <Enter>~. (aka <Enter><Shift-Backtick><Period>)
Indeed, this should be processed client-side. I've never had a problem killing a hung connection once I remembered to always prefix the escape with a newline.
~ Tim
More information about the openssh-unix-dev
mailing list