Using SSH to Forward a Remote Port Locally

A recent job reminded me that ssh can be used to for­ward a port on a remote sys­tem to one on the local cli­ent machine, like so:

ssh -L 8000:localhost:80 username@remoteserver

In that example, I could now visit http://localhost:8000 in a web browser to access the remote web server over the ssh con­nec­tion. This is use­ful for troubleshoot­ing or set­ting up ser­vices before allow­ing pub­lic access.

Pos­sibly Related Posts

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>