Assume you have a remote host with ip
rhost_ip and user
remote_user which you can connect by
Assume you need to connect from localhost to port
8080 (or any other), But you have no
8080 ports allowed/forwarded to public ip (
In this case, you can forward it over
ssh -L 8080:localhost:80 remote_user@rhost_ip
This will start ssh session and make forwarding which will live with the session.
Then just connect to
localhost:8080 and it will access you to remote host port
8080port should not be already used(binded) on
localhostbefore run ssh command.