Troubleshooting SSH Tunnel – Local Port Forwarding Failed For Listen Port


While trying to establish an SSH Tunnel to my webhost (Siteground) I encountered an error where I could push to the server but not pull. Using a program called SSH Tunnel I was able to see through the log that my local port forwarding listen port was failing. I had mirrored my listen port to be the same as the port listed for Siteground “18765” and tried a lot of other listen ports as well. The problem ended up being my own ip that I had listed!

Like most people I use google to just search “what’s my ip” and you’ll get a result back right in the search results.

screen-shot-2016-10-13-at-11-10-55-am

Turns out this was a big mistake. I suspect because I am behind a corporate firewall. I also could not for the life of me figure out what the correct listening port was for me. Turns out all I needed to do was run a simple netcat command

nc -v address_of_target port_of_target

or in this case:

nc -v m54.siteground.biz 18765

The -v command stands for “Make it verbose” or basically “give me info on this connection”. And I was able to get the exact info I needed.

screen-shot-2016-10-13-at-11-22-59-am

the src info was exactly what I needed to set up my SSH tunnel, and it even revealed my listening port that I had been having so much trouble finding!

+ There are no comments

Add yours