Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I need to make a tunnel from Linux to my Windows 7 machine. I have been able to get it to work with Cygwin, but it's not possible to remove the tunnel later.

To create the tunnel, I type:

ssh -f -N -L 5001:localhost:3306 target

The tunnel goes up with no issues. However, there doesn't seem to be a way to kill it. TCPView shows the process as <non-existent>, but does give a ProcessID. The ProcessID has already terminated and if I right-click and select "Close Connection". Nothing happens.

Short of a reboot or network enable/disable, what can I do to get rid of this tunnel?

share|improve this question

1 Answer 1

I don't use Cygwin that often, but try checking to see if the ssh process or any of its children still have open files. If Cygwin has an lsof port, you can use that, but if not, you can also try Process Explorer, or maybe dig around in the /proc//fd directory.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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