3 ms·
The ssh escape sequence "~" (without quotes) comes in handy at times. "~ C" Gives you a ssh command prompt. Press ? for help. "~ ." Clos
by xtacy 15y ago
The ssh escape sequence "~" (without quotes) comes in handy at times.
"~ C" Gives you a ssh command prompt.
Press ? for help.
"~ ." Closes the ssh connection; useful for
unresponsive ssh connections!
- LiveTheDream 15y agoWorth noting that you need a newline before the ~ for it to work. Another useful tip to know is how to set your own escape key. ssh -e ^ example.com This will set the escape key to ^ instead of ~. I had to use this recently to terminate an ssh connection that was initiated inside of a screen session on a machine I was sshed into from my laptop. Obviously, the generic ~. killed the first ssh session (on my machine), not the one in the screen. Connecting to the middle machine with ssh -e^ let me send ~. to the proper ssh session.
- fugue88 15y agoInstead of changing the escape, you can tap it one more time. So, to drop your 2nd (nested) connection: ~ ~ .