{"id":170,"date":"2026-04-19T10:27:03","date_gmt":"2026-04-19T09:27:03","guid":{"rendered":"https:\/\/vpp.dk\/?linux_trick=ssh-tunnel-forward-a-remote-port-locally"},"modified":"2026-04-19T10:27:03","modified_gmt":"2026-04-19T09:27:03","slug":"ssh-tunnel-forward-a-remote-port-locally","status":"publish","type":"linux_trick","link":"https:\/\/vpp.dk\/?linux_trick=ssh-tunnel-forward-a-remote-port-locally","title":{"rendered":"SSH tunnel \u2014 forward a remote port locally"},"content":{"rendered":"<p>Access a service running on a remote server as if it were local. Useful for databases, dev servers, etc.<\/p>\n","protected":false},"template":"","meta":{"_trick_code":"# Forward remote port 5432 to local port 5432:\nssh -L 5432:localhost:5432 user@remote-host\n\n# Persistent background tunnel (no shell):\nssh -fNL 8080:localhost:80 user@remote-host","_trick_uploader":"tunnelvision"},"trick_category":[17,21],"class_list":["post-170","linux_trick","type-linux_trick","status-publish","hentry","trick_category-networking","trick_category-ssh-remote"],"_links":{"self":[{"href":"https:\/\/vpp.dk\/index.php?rest_route=\/wp\/v2\/linux_trick\/170","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vpp.dk\/index.php?rest_route=\/wp\/v2\/linux_trick"}],"about":[{"href":"https:\/\/vpp.dk\/index.php?rest_route=\/wp\/v2\/types\/linux_trick"}],"wp:attachment":[{"href":"https:\/\/vpp.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=170"}],"wp:term":[{"taxonomy":"trick_category","embeddable":true,"href":"https:\/\/vpp.dk\/index.php?rest_route=%2Fwp%2Fv2%2Ftrick_category&post=170"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}