Saturday, 15 February 2020

SSH Port Tunnelling Example

Run this command to tunnel server port SERVERPORT to localhost port LOCALPORT:
sudo ssh -L LOCALPORT:localhost:SERVERPORT myserver.com

For example, tunnel server port 80 to localhost port 8080:
sudo ssh -L 8080:localhost:80 myserver.com

Now, instead of opening:
http://myserver.com:80

Open:
http://localhost:8080

No comments:

Post a Comment