Never too old to learn:
- [Wayback/Archive.is] Quit Nested SSH Sessions
works with ssh as well but is much simpler: press as many
~as level of nest before.(by default,~is the escape character while.is to terminate ssh). - [Wayback/Archive.is] How can I break out of ssh when it locks? – Ask Ubuntu
Notice that because hitting
~~causessshto send the~instead of intercepting it, you can address N nestedsshconnections by hitting~N times. (This only applies to~s that directly follow an Enter.) That is to say thatEnter~~~~~.terminates ansshsession 5 layers deep and keeps the other 4 intact.
So this is basically an extension of my 2017 blog post OpenSSH Escape Sequences (aka Kill Dead SSH Sessions) – The Lone Sysadmin (:
–jeroen







