I have a reverse SSH tunnel set up that is tunneling into my server. The remote servers web page can then be accessed via localhost:8080 on my server (just tested via curl). I want to make this service available to the rest of the network. How do I do that? UFW is inactive so I don't think that is what is causing me not to be able to connect from the network.


Forwarding ports from remote machines to SSH tunnels is disabled by default on Ubuntu 18.04, it will only forward requests from localhost, as you have tested.

To enable remote machines from the network to access your SSH tunnel, you have to edit SSH Server settings:

echo 'GatewayPorts yes' | sudo tee -a /etc/ssh/sshd_config

(you may notice there's a commented-out line #GatewayPorts no in this file, as it is the default)

Now restart the SSH service:

sudo service ssh restart

Now port forwarding into your SSH tunnel should work when requested from remote hosts

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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