Tunnel to Production PostgreSQL Database
As any responsible sys admin, I only allow local connections to my production database server. This means that if I need to access my DB from my local machine I would most likely need to use an SSH tunnel in order to connect.
For some reason, pgadmin3 no longer seems happy on Ubuntu 16.04 LTS and I am not able to make an SSH tunnel. In addition, it is a bit annoying that you are not able to save passwords with an SSH tunnel by default in pgadmin3, especially since my password is a long and random 50 character string.
The solution is pretty simple using the -L SSH flag.
ssh -L 15432:localhost:5432 $USER@$SERVER
This command creates a tunnel on my production server, and forwards port 5432 (the default PostgreSQL port) to my local port 15432. This allows me to connect using pgadmin3 as if the database were running on my local machine.
Thank you for reading! Share your thoughts with me on bluesky, mastodon, or via email.
Check out some more stuff to read down below.
Most popular posts this month
- 2024
- Reinstalling Windows at 1am
- SQLite DB Migrations with PRAGMA user_version
- My Custom Miniflux CSS Theme
- How to Disable Wayland in Debian Testing
Recent Favorite Blog Posts
This is a collection of the last 8 posts that I bookmarked.
- The AGI economy is coming faster than you think from Freethink
- Rolling the ladder up behind us from Xe Iaso's blog
- In Praise of “Normal” Engineers from charity.wtf
- Reports of Bluesky's death have been greatly exaggerated from The Torment Nexus
- What Would a Kubernetes 2.0 Look Like from matduggan.com
- We Can Just Measure Things from Armin Ronacher's Thoughts and Writings
- The Gentle Singularity from Sam Altman
- Whale Watching from https://popagandhi.com/
Articles from blogs I follow around the net
A Borges story about a guy who gets AI to summarize all the world’s information for him, and then summarize the summary, until the AI has the whole world summarized into a single word. He sits alone at his desk, staring at the word, repeating it endlessly, certain he is experiencing everything
[email protected]/Bluesky
via Manual do Usuário July 15, 2025Arcadia Finance exploited for $3.5 million
The Arcadia Finance defi margin protocol was exploited for $3.5 million after an attacker found a vulnerability in a project smart contract. The attacker quickly swapped the stolen tokens and bridged them from Base to the Ethereum ma…
via Web3 is Going Just Great July 15, 2025Back to the Future
This past weekend, I decided to take a trip down memory lane and take a look at the evolution of this blog’s design over the years (with a little help from the Wayback Machine). While I’ve really enjoyed the challenge of making an obsessively backwards co…
via flower.codes July 15, 2025Generated by openring