How to make ssh tunnel open to public?

How to make ssh tunnel open to the public and listen on all interfaces

1 - On the remote server trun on GatewayPorts 

vim /etc/ssh/sshd_config

GatewayPorts yes

restart the ssh service 

2 - On the client 

ssh -R [bind_address:]port:host:hostport
When bind_address is omitted (as in your example), the port is bound on the loopback interface only. In order to make it bind to all interfaces, use

ssh -R 0.0.0.0:8080:localhost:80 -N root@example.com

Comments