Access a private PostgreSQL instance through a bastion.
Section: Tunnel Recipes
PostgreSQL tunnel
bash
bash
ssh -fN -L 5432:postgres.internal:5432 bastion.example.comExplanation
Access a private PostgreSQL instance through a bastion.
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 Tunnel Recipes
Clear configured forwards on command line
Override config-defined forwards for one invocation.
Create a local port forward
Forward a local port to a remote host and port.