7

Suppose I ssh from my laptop to a server alpha, then from there ssh to a server beta.

If the connection from alpha to beta dies, is it possible to pass SSH's escape (~.) across the ssh connection from my laptop to alpha, to the ssh client connected to beta?

1 Answer 1

9

I think man ssh says it all:

-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.

You need to send ~~. Alternatively you could change the escape character for every ssh hop you take with ssh -e escape_char.

You can also specify it as a runtime option; e.g. -o EscapeChar=:

Thus you may also add it to your client config file ${HOME}/.ssh/config.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .