Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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".



I'd never expected ssh to have an interactive shell. Thanks for sharing that.


Also 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: