Maintenance

  • Home
  • Log in
  • « wget/grep/utf-16
  • teiJenkins update borked apache proxying; fix found »

pgAdmin3 SSH tunnel setup (updated for v4)

Posted by gregster on 03 Oct 2014 in Servers, Activity log, Documentation

pgAdmin4
pgAdmin4 is now a localhost, web-based app (node.js I think).
Postgres has a repo that has bionic in it, so to install:

  1. sudo echo "deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main" >> /etc/apt/sources.list.d/pgdg.list
  2. wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
  3. sudo apt update && sudo apt install pgadmin4

To run/use the app:

  1. Run the launcher. It will open the app in your browser
  2. Click 'Add New Server' in the Dashboard
  3. In the 'General' panel that opens, provide a name for the connection
  4. Switch to the 'Connection' panel and provide the info as follows
    1. Host name: service/machine name or IP address of host
    2. Port: 5432 (this is the standard PG port)
    3. Username: your u/n for the DB
    4. Password: leave blank
  5. Switch to the 'SSH Tunnel' panel and provide the info as follows
    1. Click the 'Use SSH tunnelling' button
    2. Tunnel host: machine name/IP address of machine that is in the PG ACL (SSH access to this machine is req.)
    3. Tunnel port: 22
    4. Username: the username on the tunnel host
    5. Password: leave blank
  6. Once you try to connect you should be asked for the password to the SSH tunnel host and the Postgres machine. Provide those and you should be in.

pgAdmin3
To create a connection to a remote PostGreSQL DB you either need to get your local machine added to the PG ACLs or set up an SSH tunnel. Fortunately, the recent builds of pgAdminIII have an easy-peasy tunnel config tab. In case it isn't obvious, here's how to set it up:
File -> Add server... (or click the power plug icon in the top panel)
Properties tab -> Name: anything you like
Properties tab -> Host: e.g. mydb.domain.ca
Properties tab -> Port: probably 5432
Properties tab -> Service: leave blank
Properties tab -> Maintenance DB: postgres
Properties tab -> Username: your admin u/n for the DB
Properties tab -> Password: your admin p/w for the DB
SSH Tunnel tab -> Use SSH tunneling: check
SSH Tunnel tab -> Tunnel host: machine.domain.ca (this is a remote machine that has a PG ACL entry for the DB AND that you have SSH access to)
SSH Tunnel tab -> Tunnel port: non-standard SSH port (useful for host-only VMs) - new in v1.22
SSH Tunnel tab -> Username: the shell account u/n for the tunnel host above
SSH Tunnel tab -> Authentication: choose password, unless you know that you're using an ID file (SSH keys)
SSH Tunnel tab -> Password/Passphrase: either the p/w for the shell account above or the SSH keys passphrase to unlock the key

This entry was posted by Greg and filed under Servers, Activity log, Documentation.

Maintenance

This blog is the location for all work involving software and hardware maintenance, updates, installs, etc., both routine and urgent.
  • Home
  • Recently
  • Archives
  • Categories

Search

Categories

  • All
  • Announcements
  • Hit by a bus
  • Labs
    • Activity log
    • Documentation
  • Notes
  • R & D
    • Activity log
    • Documentation
  • Servers
    • Activity log
    • Documentation
  • Tasks

All blogs

  • Academic
  • AdaptiveDB
  • Admin
  • Announcements
  • CanMys
  • Cascade
  • CGWP
  • ColDesp
  • Depts
  • DVPP
  • Endings
  • HCMC Blogs
  • Landscapes
  • LEMDO
  • Linguistics
  • Maint
  • LondonMap
  • Mariage
  • MoM
  • Moses
  • Pro-D
  • Projects
  • ScanCan
  • HumsSites
  • Wendat

This collection ©2025 by admin • Help • CMS engine