Acho que man ssh
diz tudo:
-e escape_char
Sets the escape character for sessions with a pty (default: ‘~’). The escape character is only recognized at the beginning of a line. The escape character followed by a dot (‘.’) closes the connection; followed by control-Z suspends the connection; and followed by itself sends the escape character once. Setting the character to “none” disables any escapes and makes the session fully transparent.
Você precisa enviar ~~.
Alternativamente, você pode alterar o caractere de escape para cada ssh hop que você pegar com ssh -e escape_char
.