So 25. Mär 11:03:51 CEST 2012

SSH escape character

Today I have a nice tip for our regular ssh users out there. It's the EscapeChar config parameter.

Some might recall sending $CHR(27) from their C64 to an attached Epson compatible dot matrix printer: then the next character will not be printed, but is interpreted as a configuration parameter (like bold face, underline, etc).

Users of GNU screen often type CTRL-A plus something, where something controls the screen session (like changing screen, creating a new one, or killing it). Also telnet comes with a bunch of escape sequences. But what about SSH?

You can define your escape character as an EscapeChar in your ~/.ssh/config, or via the -e switch at start time. To be effective, the escape character has to be typed on a new line. Let's assume ~.

Then ~~ gives a literal ~; ~? prints a help, ~. kills the connection. With ~# you see active port forwardings. Wait, you forgot to forward a port, again? No problem any longer: ~C gives you a command line that lets you add (or remove) port forwardings.

Have a lot of fun.

Posted by osti | Categories: Linux