How can one send commands to the "inner" ssh session?

Posted by iconoclast on Server Fault See other posts from Server Fault or by iconoclast
Published on 2012-10-05T14:59:44Z Indexed on 2012/10/05 15:40 UTC
Read the original article Hit count: 261

Filed under:

Picture a scenario where I'm logged into a server (which we'll call "Wallace") from my local machine, and from there I ssh into another server (which we'll call "Gromit"):

laptop ---ssh---> Wallace ---ssh---> Gromit

Then the ssh session from Wallace to Gromit hangs, and I want to kill it. If I enter ~. to kill ssh, it kills the ssh session from my laptop to Wallace, because the ~ is intercepted by that ssh session, and the . is taken as a command to kill the session. How do I send a command to the ssh session between Wallace and Gromit? How do I kill my "inner" ssh?

© Server Fault or respective owner

Related posts about ssh