Administer postgres from PGAdmin on remote mac using ssh tunnel

Posted by Aidan Ewen on Server Fault See other posts from Server Fault or by Aidan Ewen
Published on 2012-11-15T16:31:14Z Indexed on 2012/11/15 17:02 UTC
Read the original article Hit count: 396

Filed under:
|
|

I've got PostgreSQL installed on a Ubuntu server and I'm trying to connect to that server using PGAdmin on a remote macbook.

I've created an ssh tunnel -

macbook:~postgres$ ssh -L 5423:localhost:5432 [email protected]

And I can connect using psql on the macbook as expected -

macbook:~ me$ psql -U postgres -p 5423 -h localhost
...
postgres=#

In the 'New Server Registration' window on PGAdminIII I'm entering the following credentials -

Name - MyServer
Host - localhost
Port - 5423
Maintenance DB - postgres
Username - postgres
Password - <remote_postgres_password>

However the connection fails -

Error connecting to the server: FATAL: password authentication failed for user "postgres"

Not sure what's going on here, these seem to be the same credentials I've used for psql.

© Server Fault or respective owner

Related posts about ssh-tunnel

Related posts about ubuntu-12.04