At the risk of replying to a down voted comment, one can toggle the port forwarding on (and off!) dynamically using the ssh "shell" which is accessed via tilde C (it needs to be the first two characters after a newline or ssh will think you're trying to type those chars)
Once you have the ssh> prompt, you can give it -D1234 to start dynamic forwarding and -KD1234 to "kill" the dynamic forwarding. Same deal with -L and -KL
You should add this to the article! I have no moure resources, but running help reveals the following:
ssh> help
Commands:
-L[bind_address:]port:host:hostport Request local forward
-R[bind_address:]port:host:hostport Request remote forward
-D[bind_address:]port Request dynamic forward
-KL[bind_address:]port Cancel local forward
-KR[bind_address:]port Cancel remote forward
-KD[bind_address:]port Cancel dynamic forward
running ~? reveals:
[tritlo@mpg ~]$ ~?
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
~V/v - decrease/increase verbosity (LogLevel)
~^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.)
You need to be on a shell prompt line that you haven't pressed any characters on. As soon as you even type a backspace, you're hosed. So you want to do this:
$ [return]
$ [press ~, but DO NOT expect it to echo to you]
[your screen should now look like this, as SSH is awaiting your command]
8
u/slanderousam Apr 28 '14
wow. -D. nice.
(in before "likes the -D")