I used SSH -L 10002:192.168.0.30:10002 192.168.1.135 to establish port forwarding but now I need to remove it. How do I do this

link|improve this question

67% accept rate
feedback

2 Answers

up vote 2 down vote accepted

If you are using Linux you can kill the process by:

ps aux | grep ssh

and then use

kill -9 <id>

To kill the process

link|improve this answer
9  
No. No. No. Please, please, please do not use kill -9 until after you've tried just kill. Many processes will have signal handlers which will clean up their use of resources, cleanly close connections and other pre-shutdown tasks. If you kill with -9, the process dies immediately without doing the cleanup. Killing without -9 will work most of the time. – Doug Harris Dec 23 '09 at 18:44
3  
kill -9 without reason is like using a shotgun to kill a mosquito. :) – Darren Hall Dec 23 '09 at 21:24
feedback

You could use the "escape-key" (usually ~) followed by C to get a cli to your connection. You can from there remove tunnels without taking down your connection.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.