Waseem Daher of Ksplice posted some interesting SSH trick on his blog recently. Most of them are old-hat, but one in particular was interesting to me – SSH’s escape key (tilde). This lets you send commands to the SSH session itself, like backgrounding the session.
chris@localhost ~ $
chris@localhost ~ $ ~?
Supported escape sequences:
~. - terminate connection (and any multiplexed sessions)
~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
(Note that escapes are only recognized immediately after newline.)