LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 12-18-2006, 05:03 PM   #1
andreag
LQ Newbie
 
Registered: Jan 2006
Posts: 6

Rep: Reputation: 0
Reverse SSH tunnel active only from localhost


hi.
I'm finding a little difficult to set up a remote tunnel.
the situation is this: I am running a webserver but my ISP uses NAT and I can't connect to it when I'm not at home.
since I have another working linux box with public static IP I figured a reverse tunnel on port 80 would solve all my troubles.
the situation looks like this:

MYWEBSERVER<-->ISP[NAT]<--WWW-->MYLINUXBOX

so I googled a little and found this way to set up a tunnel (the ssh command was run from the MYWEBSERVER shell, hence the 'localhost'):

ssh -nNT -R 80:localhost:80 root@MYLINUXBOX

seems all fine (no error messages) but when I type MYLINUXBOX's address into the web browser all I get is a 'connection refused' message.
BUT (and here is the big mystery) if I open an ssh shell on MYLINUXBOX and type 'lynx localhost' , I can see MYWEBSERVER's website!
btw, before anybody asks, iptables is not installed.

what could be the problem?
 
Old 12-18-2006, 05:22 PM   #2
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
man ssh

Carefully.

Especially -g - allow connections from everywhere.
 
Old 12-19-2006, 02:05 AM   #3
asgozzi
LQ Newbie
 
Registered: Mar 2006
Posts: 8

Rep: Reputation: 0
hey thanks for the immediate answer.
btw I also had to add to 'sshd_config' the 'GatewayPorts yes' option.
now works flawlessly!
 
  


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
PPTP Reverse(synchronous) Tunnel otisthegbs Linux - Networking 2 09-13-2006 07:07 PM
SSH reverse tunnel (lo only? why not eth0) Dinomight Linux - Networking 3 08-17-2006 09:44 PM
ssh + pop3 with kmail: Could not connect to host localhost, but ok without ssh Emmanuel_uk Linux - Networking 0 07-20-2006 04:56 PM
djbdns -- Can't reverse localhost on OpenBSD -- please help me b:z *BSD 1 06-12-2005 09:58 AM
Reverse SSH Tunnel sniggleflop Linux - Security 1 10-13-2002 01:24 PM

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

All times are GMT -5. The time now is 01:04 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