Cheatsheet Pages / SSH Cheatsheet
How to bring a remote port to your machine — ssh -L local forwarding
A service on (or behind) the server should appear on your localhost.
Every flag and config keyword was checked against the OpenSSH 9.6 man pages, and the config examples were parsed for real with ssh -G.
ssh -L 8080:localhost:80 deploy@example.com
# http://localhost:8080 on YOUR machine now hits port 80 on the server
ssh -L 5433:db.internal:5432 deploy@example.com
# ...or reach a third machine (db.internal) through the server you're logged into
