Re: Forwarding Web server requests to local machine



Hello,

on 04/11/2007 10:41 PM Richard E. Silverman said the following:
You need to set "gatewayports yes" in sshd_config.

Yes, thanks Richard. I also figure I had the IP wrongly set. I should
specify the local IP like this.

ssh -R 80:127.0.0.1:80 -N -2 root@xxxxxxxxxxxx

Now I have another problem. I want the server to listen only on a
specific a spare IP, so I used this command:

ssh -R 123.45.67.89:80:127.0.0.1:80 -N -2 root@xxxxxxxxxxxx

The problem is that ssh listens on all IPs that are on the same network
card interface of 123.45.67.89. I have other IPs on the same interface
listenying to port 80, so ssh fails to listen on port 80.

Is there a way to tell ssh to listen only on port 80 of IP 123.45.67.89 ?



"ML" == Manuel Lemos <mlemos@xxxxxxx> writes:

ML> Hello, I am testing a Web application that is going to be
ML> connected by a remote server that I do not control (actually
ML> Paypal IPN sandbox).

ML> I would like the remote server to connect my Web server on a local
ML> development machine.

ML> The local machine is connected to the Internet via an ADSL
ML> connection, but the ISP blocks port 80.

ML> I have a dedicated server elsewhere with a spare IP address. So I
ML> thought of using ssh to forward port 80 connections to that remote
ML> server IP address to port 80 my local development on which I have
ML> my test Apache running.

ML> I used this command in my local machine:

ML> ssh -R 80:123.45.67.89:80 -N -2 root@xxxxxxxxxxxx

ML> 123.45.67.89 is the spare IP of my dedicated server. I have other
ML> IPs in that machine. I also have Apache servers listening in other
ML> IPS.

ML> The forwarding seems to be setup but it always refuses
ML> connections.

ML> I executed netstat -a -n -t on my dedicated server machine and I
ML> can see an entry like this after I leave the ssh command above
ML> running:

ML> tcp 0 0 ::1:80 :::* LISTEN

ML> On the local machine I have Apache running. Running netstat -a -n
ML> -t shows an entry like this:

ML> tcp 0 0 :::80 :::* LISTEN

ML> Anybody knows why http://123.45.67.89/ always refuses connections?

ML> --

ML> Regards, Manuel Lemos

ML> Metastorage - Data object relational mapping layer generator
ML> http://www.metastorage.net/

ML> PHP Classes - Free ready to use OOP components written in PHP
ML> http://www.phpclasses.org/



--

Regards,
Manuel Lemos

Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
.



Relevant Pages

  • Re: network programming: how does s.accept() work?
    ... The program you contact at Google is a server. ... so, the server will usually assign a new port, say 56399, specifically ... connections to a server remain on the same port, ... sockets is what identifies them. ...
    (comp.lang.python)
  • Nimda.E/unknown memory resident, internet-aware processes
    ... a client's NT 4.0 server was infected with what appeared to be ... network traffic and saw several suspect connections. ... one other connection to port 2787. ... along with about 500 other compromised systems on just that one IRC server. ...
    (Incidents)
  • Re: iptables newbie question
    ... so it's not a dedicated server. ... > merely want to limit connections on that port ONLY to the e-mail server ... do you want to be able to establish connections out to ... The same sort of thing happens for any request you make - dns, ntp, web, ...
    (comp.os.linux.security)
  • Re: Sun Volume Manager or Solaris Disk Suite
    ... keyboard or mouse connections. ... I have to buy a RJ45 cable that will connect to a DB9 adapter on one ... port). ... How would putty know that I am trying to connect to a server via a com ...
    (comp.sys.sun.admin)
  • Re: Port Forwarding -- Checking to be sure I understand it
    ... They run an ssh ... server and VNC service. ... If you want to run the tunnel over some port other than 22 (the ... restrictive firewalls that deny all incoming connections and block most ...
    (comp.security.ssh)