I've used ssh to port forward for many years and this morning it seems broken. Strange part is I can't seem to find out why. So obviously I'm insane....so i'm doing so investigation as to why...happy if someone can offer some suggestions.
first my local machine is set up to forward a port to my remote host as such
ssh -T -L 3901:remote.host.net:3907 -C -N
user@remote.host.net
I have an application open and listening on port 3907 on remote.host.net. Its sitting there and pumps the input to stdout. The ssh connection works fine and establishes without any problems.
If I use the following from the local machine
telnet localhost 3901
It gets a connection. Interesting part is my server on remote.host.net doesn't see the connection.
If I look on remote.host.net with lsof at port 3907 i get
sshd 19084 user 7u IPv4 149580 TCP remote.host.net:57114->remote.host.net:3907 (SYN_SENT)
This seems to indicate that the ssh connect is good and the port forwarding is correct. Issue is why isn't my server seeing any data? Where to from here?
Next item is if I kill my server on remote.host.net and run the following
nc localhost 3907
It appears to indicate that it can make a connection...that is it doesn't just stop it stays connected. It doesn't show any data however. netcat seems to do this on any port I select....which is plain weird.
an lsof on nc running yields
nc 26335 root 3u IPv4 158715 TCP localhost.localdomain:54427->localhost.localdomain:3907 (SYN_SENT)
I think this explains why my server isn't getting any data...something else is.
I've checked my firewall on the remote host and it isn't droping packets....and its not my local firewall because I wouldn't see the connection at the remote end...so I'm lost....
Why is nc indicating a connection on any port? how do I find out what is answering nc? a netstat -anp yields
tcp 0 1 127.0.0.1:54427 127.0.0.1:3907 SYN_SENT 26335/nc
So I'm lost.....anyone with some suggestions?
Thanks