SSH tunnel command builder
Fill in your bastion and database details — get a ready ssh command, an ~/.ssh/config block, and the connection string that points at 127.0.0.1.
ssh command
ssh -N -L 5432:db.internal:5432 -i ~/.ssh/id_ed25519 ec2-user@bastion.example.com
~/.ssh/config block
Host db-tunnel
HostName bastion.example.com
User ec2-user
IdentityFile ~/.ssh/id_ed25519
LocalForward 5432 db.internal:5432Connection string (via 127.0.0.1:5432)
postgresql://app@127.0.0.1:5432/mydb
-N: don't run a remote command, just forward ports. -L: forward the local port to the database host/port, as seen from the bastion. -J: hop through a jump host before reaching the bastion. -i: the private key to authenticate with.
Runs in your browser. Nothing you type is sent anywhere.
How this works
- -N: don't run a remote command, just forward ports. docs ↗
- -L <local>:<dbhost>:<dbport>: forward the local port to the database host and port, as seen from the bastion. docs ↗
- -J <jump>: hop through a jump host before reaching the bastion, when your network requires it. docs ↗
- -i <key>: the private key file to authenticate with.
Read more
Do this against your live database in Tablyne.
PostgreSQL GUI →FAQ
Why -N and not just ssh user@bastion? +
-N tells SSH to skip opening a remote shell — the connection exists only to carry the forwarded port, which is what a database tunnel needs.
What goes in the database host field? +
The database's address as reachable from the bastion — often a private/internal hostname or IP that isn't reachable directly from your machine.
Do I need -J? +
Only when the bastion itself isn't directly reachable and you must hop through another jump host first; most single-bastion setups can leave it blank.