Cheatsheet Pages / SSH Cheatsheet
How to expose your local app through a server — ssh -R remote forwarding
A colleague needs to test the dev server running on your laptop.
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 -R 9000:localhost:3000 deploy@example.com
# on the SERVER, localhost:9000 now reaches the app on YOUR localhost:3000
# default bind is the server's loopback only — other machines can't reach it;
# exposing it further needs GatewayPorts yes in the SERVER's sshd_config (an admin call, not a client flag)
# classic use: let a colleague test the dev server running on your laptop
Good to know
By default the forwarded port binds only the server's loopback — other machines cannot reach it. Exposing it further needs GatewayPorts yes in the server's sshd_config, which is an admin call, not a client flag.
