4 ms·
While in an SSH session, press enter, then type tilde and capital C (enter ~C) and you can add command line options to the current session. To add a port forwar
by jasongill 7mo ago
While in an SSH session, press enter, then type tilde and capital C (enter ~C) and you can add command line options to the current session. To add a port forward from your local 8080 to the remote port 80 without closing the connection, do:
enter ~C -L 8080:localhost:80
- zimpenfish 7mo agoThat is a neat trick. Added to the list. (Ultimately unhelpful though because I use mosh everywhere these days and that doesn't appear to have anything fancy like this.)
- dylan604 7mo agoMaybe it's just still too early in the morning yet, but what is the significance of hitting enter first?
- jasongill 7mo agoSSH expects the escape sequence (tilde) to be the first character on a new line; since backspace is sent as a character, you can't just backspace over something you've started typing and then press tilde to have it recognized. Technically, you don't have to press enter if you've not typed anything (try it in a new SSH session - as soon as you are logged in, type ~? to get the SSH help output), but since the comment was about doing this during an active session without ending it, I figured noting that pressing enter first to be sure you're on a new line wouldn't hurt
- Tepix 7mo agoThanks. This could really benefit from a TUI!