SSH Tunneling Fun

forward all connections to my localhost:8080 to port 80 on remote.host

# ssh -L 8080:localhost:80 user@remote.host

forward all connections to my localhost:8080 to port 80 on the router gateway of another network.
very handy for remotely gaining access to boxes (eg: adsl router configs) that do not have remote access setup by default.

# ssh -L 8080:192.168.0.1:80 user@remote.network.host

forward all connections that connect to the remote box on port 80 through to my local box on port 8080.
could be used to give someone on a remote network secure access to a service on your local network.
eg: without setting up port forwarding in your router anywhere.

# ssh -R 80:localhost:8080 user@remote.host

 

Leave a Reply

Your email address will not be published. Required fields are marked *