Alexander Bird
Alexander Bird

Reputation: 40599

can I do ssh port forwarding after I've already logged in with ssh?

I have an Ubuntu server example.com and I have ssh'ed into it. But only after I ssh into it, do I realize that I meant to do ssh -L 8000:localhost:9000 example.com. Is there a way to create that tunnel in an already established and running ssh connection?

Upvotes: 4

Views: 3613

Answers (1)

Joshua
Joshua

Reputation: 43188

If you set your escape character with EscapeChar option in ~/.ssh/config or with the -e option you can.

Assuming an escape of ~: ~C-L 8000:localhost:90000 will do it.

Upvotes: 8

Related Questions