LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   SSH tunnel only listening on loopback device. Should also listen on eth0 (https://www.linuxquestions.org/questions/linux-networking-3/ssh-tunnel-only-listening-on-loopback-device-should-also-listen-on-eth0-703465/)

paranoid times 02-09-2009 06:28 PM

SSH tunnel only listening on loopback device. Should also listen on eth0
 
I have a server at home. Work normally just connects up to it with a reverse ssh connection such that I can get at the work computer easily. The work computer does a few tunnels one for ssh and another for http. The home server recently died. How convent it was that I was working on a new one at the time. Unfortunately it wasn't quite as complete as I expected.

The SSH tunnel is still working fine (after all the keys and such had been copied over). The HTTP tunnel isn't working the way it use to.

server: IP: 192.168.0.57
home computer: IP: 192.168.0.90
work computer: IP: 10.5.2.28

Previously I would connect to work by pointing my home computer at "192.168.0.57:8220" and if I wanted to connect to ssh I would connect up to the server and ssh to "127.0.0.1:9220" netstat is currently showing this:

Code:

tcp  0    0  127.0.0.1:9220      0.0.0.0:*        LISTEN     
tcp  0    0  127.0.0.1:8220      0.0.0.0:*        LISTEN

It use to look like this:

Code:

tcp  0    0  0.0.0.0:9220      0.0.0.0:*        LISTEN     
tcp  0    0  0.0.0.0:8220      0.0.0.0:*        LISTEN

The command that I use to connect up the tunnel is/was (I would just leave it in the crontab running periodically):
Code:

ssh -axfTCR 8220:127.0.0.1:80 michael@home sleep 6h
ssh -axfTCR 9220:127.0.0.1:22 michael@home sleep 6h



I've tried putting a -g on the options. Along with putting the ip address of the home server in front of the port (192.168.0.90:8220:127...) I've looked through ssh_config and sshd_config on both sides. But nothing has stuck out to me or worked yet. The one notable difference that I could think of is the old server (that recently died) was Fedora 2 the new server is CentOS 5.2.

Any thoughts on what could get this working would be greatly appreciated.

Thanks,
Michael

routers 02-09-2009 09:57 PM

Maybe you can try this way

ssh -axfTCR eth0-ip:8220:127.0.0.1:80 michael@home sleep 6h

because this is the way i tunnel in the linux gateway and keep alive
(ssh -f user@idcserver.net -p 8022 -L 192.168.1.1:8080:idcserver.net:8118 sleep 30d)

hope you get the idea with this

unSpawn 02-10-2009 02:17 AM

Also look for 'autossh', it keeps tunnels alive automagically.

paranoid times 02-10-2009 02:20 PM

It seems that adding:
Code:

GatewayPorts yes
To the sshd_config file on the home server has made it work. (found at: http://ask.metafilter.com/52931/ssh-...on-remote-side)

Thank you very much for your help though and for letting me know about autossh, I didn't know that it existed and could be much nice then a cron script.

Thanks again,
Michael


All times are GMT -5. The time now is 02:19 AM.