Too Cool for Internet Explorer

OpenSSH Escape Characters

openssh-escape-characters

Yesterday I discovered a terrific feature of OpenSSH while reading ssh(1): Escape Characters.
It’s a wonder that I didn’t accidentally noticed from it before, but that’s just a proof of how well it actually works.

Here’s how you go:

Just type ~? and make sure that the last you typed in was nothing or a newline. SSH will then show you the list of currently supported escape sequences:

~. - terminate connection
~B - send a BREAK to the remote system
~C - open a command line
~R - Request rekey (SSH protocol 2 only)
~^Z - suspend ssh
~# - list forwarded connections
~& - background ssh (when waiting for connections to terminate)
~? - this message
~~ - send the escape character by typing it twice

For me are ~C and ~# the most important commands.
One can open or close port forwardings in the command mode – which I could have used so many times :D

And because escapes are only recognized immediately after newline, you can still cd into your homedir using cd ~

Powered by WordPress with GimpStyle Theme design by Horacio Bella. Get Entries and comments.