4

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.

My pg_hba.conf file only has the following lines -

# Database administrative login by Unix domain socket local all postgres peer # "local" is for Unix domain socket connections only local all all peer # IPv4 local connections: host all all 127.0.0.1/32 md5 # IPv6 local connections: host all all ::1/128 md5 
3
  • First place I'd look is the postgres lines in /etc/postgresql/9.X/main/pg_hba.conf Commented Nov 15, 2012 at 17:42
  • Thanks @MarlinForbes. I've spent an hour or so playing around with pg_hba.conf to no avail. I'll update my question to include my current configuration. Commented Nov 15, 2012 at 17:58
  • Hi @AidanEwen, did you find a solution for this? We're suddenly getting this issue after having no problems before. Commented Feb 24, 2022 at 1:50

1 Answer 1

0

Check if changing your postgres local line to trust (instead of peer) works.

2
  • Thanks Marlin, I'm trying to make my db server as secure as possible. I don't really want to start using trust authentication (particularly not on the postgres role). Commented Dec 8, 2012 at 20:05
  • Agreed, I'm suggesting trying that to see if it's the authentication that is the issue. Don't leave it like that if that's a problem. :) Commented Dec 12, 2012 at 8:23

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.