HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

Postgresql pg_hba.conf changes are ignored or not loaded

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
postgresqlconfignoredarepg_hbaloadedchangesnot

Problem

Using Postgresql 9.3 on Ubuntu 14.04.4 LTS

I've been changing the /etc/postgresql/9.3/main/pg_hba.conf config file madly trying to make a change that will allow me to log in with any user remotely.

My current configuration looks like so:

host all postgres /32 trust
asdf asdf asdf
1 1
1-1-1-1-


This is, of course, a completely bogus config file. However, when I run

sudo service postgresql restart
sudo service postgresql reload


Both commands succeed with status [ OK ] - there are no parse errors. I have also disabled all entries that start with local and yet I am still able to login as the postgres user.

Any attempts to log into the server remotely from the host
using:

psql -c 'SELECT version()' -h pg -U postgres


Result in:

psql: FATAL:  password authentication failed for user "postgres"
FATAL:  password authentication failed for user "postgres"


I am clearly not trying to use password authentication.

EDIT:

Running SHOW hba_file; as the postgres user yeilds

hba_file
--------------------------------------
 /etc/postgresql/9.3/main/pg_hba.conf
(1 row)


Edit 2:

Checking the logs shows that the parse errors were happening. I have cleaned out the bogus lines, leaving

host all postgres /32 trust


I am still getting a password prompt for some reason. There is nothing in the log after a failed login.

Solution

Figured it out. This was a long shot, but it may help someone who has exhausted the normal avenues or is not used to postgres.

The server I was working on had another instance running through puppet, and so the config I was modifying was not for the instance I was connecting to.

run find / -name 'postgresql.conf' to see if there are any other locations where you might have a postgres instance.

Context

StackExchange Database Administrators Q#143496, answer score: 4

Revisions (0)

No revisions yet.