Linux Blog

Forwarding Ports over an active SSH connection

Filed under: General Linux,Linux Software,Quick Linux Tutorials — TheLinuxBlog.com at 12:01 am on Tuesday, October 7, 2008

There is no doubt about it that SSH is a handy administration and remote access tool. Have you ever wanted to add port forwarding or cancel port forwarding from within an active SSH connection? Well, a feature that many do not know about is the ssh escape feature. With this pseudo terminal you can do some nifty things, such as forward ports over an active SSH connection.

To do this, follow these instructions:
(Read on …)

SSH Escape

Filed under: General Linux — TheLinuxBlog.com at 2:27 pm on Tuesday, September 2, 2008

You can get into a special area of SSH that you by using the SSH Escape key sequence.It can be set at the connection time to a custom character but if you didn’t set one it is probably set to the Tilda (~). To open the SSH Escape dialog to manage your connection (I assume you know what you want to do, but your wondering how you use it)

Its simple to use; just hit shift, then the back tick (`) to get the Tilda (~) then type the command you want to use.

For example to pull up the SSH Escape dialog help up you use the question mark (?) so do the following:

[owen@Linux_Blog ~]$ ~?
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.)

For more information on the SSH Escape Sequence check out the SSH Man Page

Post By: Owen From: TheLinuxBlog.com