5

I have a remote machine at example.com with sshd listening to port 1234 and a web service at port 5678.

For some reasons, I want to 'localize' the http requests to that web service.

When I execute

ssh -L 4321:example.com:5678 [email protected] -p 1234 -N

On the local machine (10.0.0.1), I can view the web service by navigating to:

http://localhost:4321

However, if I point the browser to:

http://10.0.0.1:4321

I get error (Error 102: net::ERR_CONNECTION_REFUSED if that makes any difference).

Is there a way to make the ssh port forwarding available under ip address rather than localhost?

I need it in order to have the remote service available for other computers on the LAN (10.0.0.0/24).

2 Answers 2

5

I just found this SSH port forwarding

ssh -L \*:4321:example.com:5678 [email protected] -p 1234 -N

is the way to go

0

When using remote port forwarding, ensure that sshd_config on server has gateway ports enabled (GatewayPorts yes). Otherwise sshd will ignore the bind interface and only bind on localhost

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .