Something that has bugged me recently is that when I go to proxy on a particular port, the port is already in use and I get the following error.
bind: Address already in use
channel_setup_fwd_listener: cannot listen to port: 8090
Could not request local forwarding.
So I had a quick look to find out how to locate the process hogging the port. All I need to do is use the lsof command.
This command returns a list of open processes on this port.
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
ssh 75782 eoin 5u IPv6 0x01c1c234 0t0 TCP localhost:8090 (LISTEN)
To free the port, kill the process using it…
[Update: Simpler solution found]
Easier to kill all ssh processes and restart them (if you use terminal aliases!), since in my case it is always an ssh process that is hogging the port.