Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have two servers server1 and server2 from server1 issue the following command

ssh user2@server2 -N -R 9080:localhost:80

Now from server2 I issue the following command:

wget http://localhost:9080

this works the file downloaded by wget is the file hosted by the webserver running on server1:80

From a independent machine I issue the following command

wget http://server2:9080

This doesn't work - the command eventually times out. I don't see any clues in server2's syslogs.

I've replaced all my firewall rules on server2 with:

iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT

iptables -L -n
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
share|improve this question

1 Answer 1

From the independent machine, connect to

wget http://server1:80

...and let server1's SSH tunnel carry it to server2's 9080 port.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.