LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-21-2007, 01:32 AM   #1
tommiy
LQ Newbie
 
Registered: Apr 2007
Posts: 1

Rep: Reputation: 0
ssh port forwarding not working


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
 
Old 04-22-2007, 08:33 AM   #2
rahulk
Member
 
Registered: Mar 2006
Posts: 110

Rep: Reputation: 16
SYN_SENT means that the connection is not complete. Why dont you do a simple test. Local forward the port 3901 from local machine onto 22 on remote machine. Try to ssh on the localhost using the port 3901 and see if it sends you to remote machine.

I think the connection is not getting complete somewhere.

rgds,
Rahul Khare
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SSH Port Forwarding wwnexc Linux - Networking 4 09-29-2005 01:26 AM
Port forwarding for ssh Adriaan Linux - Networking 1 03-08-2004 09:11 AM
Ssh port forwarding? J_Szucs Linux - Networking 1 10-29-2003 04:42 AM
ssh, and port forwarding Tricky Linux - Networking 3 01-06-2003 07:50 PM
SSH port forwarding tarballedtux Linux - Networking 2 05-29-2002 07:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration