SSH Tunnels and Forwarding Cheat Sheet/Remote forward with gateway ports

Allow remote listeners to bind beyond localhost when server policy permits it.

Section: Forwarding Basics

Remote forward with gateway ports

bash
bash
ssh -R 0.0.0.0:8080:localhost:3000 user@example.com
Explanation

Allow remote listeners to bind beyond localhost when server policy permits it.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Forwarding Basics
Create a local port forward
Forward a local port to a remote host and port.
OpenIn sheetbashsame section
Create a remote port forward
Expose a local service on the remote host.
OpenIn sheetbashsame section
Create a SOCKS proxy
Open a local SOCKS proxy for browser or CLI traffic.
OpenIn sheetbashsame section
Run a tunnel in background
Create a tunnel without running a remote shell.
OpenIn sheetbashsame section
Forward a UNIX socket
Forward a local UNIX socket to a remote UNIX socket.
OpenIn sheetbashsame section
PostgreSQL tunnel
Access a private PostgreSQL instance through a bastion.
OpenIn sheetbash2 tag match