Using pgAdmin on my mac to access PostgreSQL server remotely
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
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.