SSH Local Port Forwarding

To use SSH to forward local ports to an address use the -L option.

  • [LOCAL_IP] LOCAL_PORT - the local machine IP and port.  This will be how you connect to the forwarded address
  • DESTINATION:DESTINATION_PORT - the IP or host name of the destination machine.
  • [USER@] SERVER_IP - the remote SSH user and server IP address


ssh -L 9999:localhost:80

In the above example an SSH local forward is established on the localhost on port 9999 and connects to remote machine at  Now all traffic for the remote machine can be routed via the localhost address of localhost:9999.

See Also:

Subscribe to Independent Computing

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.