Using pgAdmin on my mac to access PostgreSQL server remotely

I've found this article which addresses the exact situation: http://library.linode.com/databases/pos … in-macos-x">http://library.linode.com/databases/postgresql/pgadmin-macos-x

However, I am a little confused by the part where I need to specify $remote_user and $remote_host in the script, as well as where I should run this script from?

Am I supposed to run this tunneling script from my local mac or on the linode server? If the latter, is the $remotehost the same as the FQDN I have in /etc/hosts on my linode, and what should be the $remoteuser in this case?

Thanks!

2 Replies

Oops. Completely failed to read the above post correctly so you can delete this message :).

Using SSH proxy like this you have two users:

1. OS user whose account you SSH into

2. Database user (created with 'createuser' or 'createrole')

In case of that script, remoteuser is the OS user, the SSH username. In that case you need pghba configured for local/host 127.0.0.1, ident or peer, and need a database user of the same name. Since the example in the script shows connecting to DB via localhost (which is the localhost on the Linode), you need the localhost setting in pg_hba, I recommend md5 method so you can authenticate with username and password and therefore have access to more than one user/database, while having single, unrelated SSH tunnel user.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct