3 ms·
You can also change/add them after the ssh session has started. This uses the escape mechanism. For help on that, hit return, type "~?" and hit return again.
by adrianmonk 5y ago
You can also change/add them after the ssh session has started.
This uses the escape mechanism. For help on that, hit return, type "~?" and hit return again.
From there you will see that "~#" will list them. And "~C" takes you to a line-oriented command prompt where you can add them.
For example, type return "~C", then at the prompt type "-L1234:localhost:22". Then in another window, type "telnet localhost 1234". Then back in the ssh window, type return "~#" and you will see the tunnel being used.
Another trick: if you don't need a shell and only want to forward ports, run "ssh -N" instead of "ssh".
- manuel_w 5y agoI'd never expected ssh to have an interactive shell. Thanks for sharing that.
- adrianmonk 5y agoAlso want to add: you can type "help" at the "ssh>" prompt. That is, hit enter, type "~C", then prompt appears, then "help" and hit enter again.