SSH question [was: FOSS app like Hamachi? ]

Ben Scott dragonhawk at gmail.com
Wed Feb 14 08:38:52 EST 2007


On 2/14/07, Paul Lussier <p.lussier at comcast.net> wrote:
> Is there a way to add a port-forwarding rule to an existing ssh session?

  Yah, you put ssh into "command mode", and then type the -L/-R switch
as you would on the command line.  You get into command mode by
sending the escape character (tilde by default), followed by a capital
C.  For example (done at a Unix prompt, but can be done anywhere,
since the destination host never sees the keystrokes):

$ ~?
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
(Note that escapes are only recognized immediately after newline.)
[~C sent here]
ssh> help
Commands:
      -Lport:host:hostport    Request local forward
      -Rport:host:hostport    Request remote forward
      -KRhostport             Cancel remote forward

-- Ben


More information about the gnhlug-discuss mailing list