Questions tagged [pg-hba.conf]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
5k views

pg_hba.conf and postgresql.conf in old installation directory

I have installed the PostgreSQL 9.4 on my MacBook via MacPorts, and I am trying to edit pg_hba.conf, but I don't see it in my current installation. Furthermore, psql is reporting that config_file is ...
0 votes
0 answers
30 views

FATAL: could not load pg_hba.conf error when including a @user file

I've got a working pg_hba.conf file in the default location that lists specific users and address (Windows PG14). The documentation states that I can also list users and address by creating a file ...
362 votes
12 answers
1.2m views

connect to PostgreSQL server: FATAL: no pg_hba.conf entry for host

I am trying to run a website sent to me but after doing so this error appeared connect to PostgreSQL server: FATAL: no pg_hba.conf entry for host "4X.XXX.XX.XXX", user "userXXX", ...
19 votes
2 answers
74k views

psql: FATAL: Peer authentication failed for user

I just installed PostgreSQL 9.4 on Ubuntu 15.10. I created a user with createuser -P myuser I created a database with createdb -O myuser mydatabase I edited pg_hba.conf and added local mydatabase ...
2 votes
1 answer
1k views

pg_hba error while setting up repmgr

Please help me to figure it out, help is much appreciated! ERROR: FATAL: no pg_hba.conf entry for replication connection from host "172.18.0.4", user "repmgr", SSL on The following is a list of my ...
0 votes
1 answer
37 views

Different authentication behaviour when starting postgres from pg_ctl and when starting from systemd

I am running postgres 9.6 cluster on ubuntu 20. All installation and starting the database is fine, however, I am experiencing a weird behavior. In the pg_hba.conf file, I am trusting any connection ...
8 votes
2 answers
13k views

How to check the syntax of pg_hba.conf and other postgresql conf files on ubuntu/debian/linux?

Many times, the postgresql service can't restart after some configuration changes. Is there any command line tool allowing to check the syntax of pg_hba.conf and other pg *.conf files before ...
11 votes
3 answers
20k views

Unexpected PostgreSQL restart

My PostgreSQL server unexpectedly restarted with such messages: 2017-08-16 03:44:34 GMT LOG: received fast shutdown request 2017-08-16 03:44:34 GMT LOG: aborting any active transactions 2017-08-16 ...
0 votes
2 answers
860 views

Store LDAP bind credentials in environment variables for pg_hba.conf

I am working on setting up LDAP authentication for a PostgreSQL database and have added the following in my pg_hba.conf file: # TYPE DATABASE USER ADDRESS METHOD host all all ...
0 votes
2 answers
2k views

Is it possible to insert multiple IP addresses in a single entry in a pg_hba.conf file?

Let's say I have the following 3 child IP addresses - 192.168.10.15 ,192.168.10.41 and 192.168.10.81 1 master IP address - 192.168.10.37 I want the 3 child IP addresses to be able to access the master ...
0 votes
1 answer
99 views

PSQL asks for password for a specific database

I am hosting two different databases (manage_invite and manage_invite_v49) on the same server. As you can see, when I try to connect them using the CLI, it demands the password for the second ...
0 votes
0 answers
753 views

pg_cron connection refused with postgres login

I am trying to run a function periodically with pg_cron but every time it wants to execute it throws connection refused. the cron job is created using the postgres user. pg_hba.conf local all ...
user avatar
0 votes
1 answer
2k views

postgresql does not seem to respect the pg_hba.conf config - how can I diagnose this?

I have the following pg_hba.conf: # TYPE DATABASE USER ADDRESS METHOD # "local" is for Unix domain socket connections only local all all ...
0 votes
2 answers
6k views

need help understanding the error-message: Error Connecting to database FATAL : no pg_hba.conf entry

We're trying to connect to a postgres/postgis installation on a remote server, using QGIS-Application. When accessing from another pc or from the same pc via pgadmin4v4 with the same credential/...
21 votes
1 answer
35k views

How do I query the running pg_hba configuration?

I want to test if a replication connection is authorized by pg_hba.conf on the provider before issuing the replication-starting command, and don't know how. (I have access to both unix and postgresql ...
1 vote
1 answer
368 views

Unable to deny remote access to Postgresql even if there is no entry in pg_hba.conf [closed]

I have 5 Postgres Servers, with IP addresses let's say as A,B,C,D and E. A is the master server and remaining are the child servers which need to access A. In the postgresql.conf file of A, the listen ...
0 votes
1 answer
377 views

Postgres authentication fails: log refers to "line 90" in pg_hba.conf that shouldn't exist

Whatever settings I try, I keep getting connection errors, from external clients as well as trying to connect from a running console on the server itself. My last attempt for a local connection with "...
0 votes
2 answers
12k views

Edit pg_hba.conf file using pgAdmin 4

This other Question has Answers about viewing and editing settings in postgresql.conf file using pgAdmin 4. But those Answers did not mention editing the pg_hba.conf file used for authentication of ...
1 vote
1 answer
319 views

script breaks my ability to run psql

I've successfully installed postgres on my Ubuntu machine. I am running a script for a website I am working on, here is the relevant code: apt-get -y install postgresql libpq-dev su postgres <<...
29 votes
6 answers
189k views

How to restart PostgreSQL server under CentOS 7

I installed PostgreSQL 10.1 under a CentOS 7.3 environment. The service is started (postmaster.pid file present under /var/lib/pgsql/10/data), but I need to reload configuration or restart the server ...
3 votes
1 answer
5k views

Error: FATAL: no pg_hba.conf entry for host - PostgreSQL - pg_hba.conf is empty

I upgraded the PostgreSQL database from version 10 to 11. As I tried to access the database from a client pgadmin4 console, I got the below error: I checked the two file postgresql.conf and pg_hba....
1 vote
1 answer
129 views

How does postgres host based authentication work?

This is a duplicate of: https://stackoverflow.com/questions/55804806/how-does-postgres-host-based-authentication-work (I was asked to shift this query to DBA.Stackexchange) I am installing DSPACE ...
1 vote
1 answer
29k views

no pg_hba.conf entry for replication connection from host

(Also posted to pgsql-general) I have been configuring a slave server that needs to connect to the host. Both the master and the standby servers have a pg_hba.conf that looks like this: # Allow ...
0 votes
1 answer
2k views

pg_hba.conf from PostgreSQL

I have no idea how to configure that pg_hba.conf file, to connect with my server via pgAdmin. Right now i was trying to add: host all all host.name.org.pl trust host all all host.name.org.pl md5 ...
7 votes
2 answers
35k views

What am I doing wrong with pg_hba.conf?

I'm trying to make it so that local connections to the database don't require a login. So I added the line local all all trust to the pg_hba.conf file, but then when I load pgAdmin and try to ...
1 vote
1 answer
686 views

pg_hba.conf entry query

I'm trying to formulate a rule from pg_hba.conf file. Thus far I have understood that pg_hba.conf file is used to give access to the specific user for a specific host. But I just want to take a second ...
3 votes
1 answer
147 views

Why does the PG manual state to modify the "pg_hba.conf" file before starting the server the first time?

The following is from https://www.postgresql.org/docs/current/static/creating-cluster.html with original emphasis on before: or modify the generated pg_hba.conf file after running initdb, but ...
4 votes
1 answer
23k views

How do I login to a Postgres database without a password?

Right now my Postgres' pg_hba.conf file has the following lines: # "local" is for Unix domain socket connections only local all all md5 # IPv4 local ...
1 vote
3 answers
1k views

Get lines of pg_hba.conf with trust method from user with minimal privileges

I try on PostgreSQL 9.3 to get the lines of pg_hba.conf where the authentication method is trust from user with minimal privileges. I wrote a function, but it doesn't work: create function public....
1 vote
0 answers
29 views

Allow databases start with specific name

In PostgreSQL sometimes we replace a database, we rename the old when a create a new one, example: Database: test Rename database to: test-04-04 (date) Create a newdatabase: test Now we have a lot ...
3 votes
1 answer
837 views

How do I enable md5 authentication for only one user?

I just installed Postgres 9.2 on CentOS 7. I want to keep peer authentication for all my users except one, which I would like to be able to access via "psql" through any user's account. I tried ...
3 votes
1 answer
7k views

pg_hba.conf allow mutliple I.P. addresses for single user

In my pg_hba.conf, I need a single user to be allowed to connect from two completely different IP addresses (like work and home, for example). Something like the following would be really nice: host ...
1 vote
1 answer
5k views

ALTER USER postgres PASSWORD null; now has locked me out of psql

I have installed postgresql version 9.3.14 on High Sierra via HomeBrew. Upon trying to access the server via psql, I was being prompted for a password for the user postgres. Using postgres as the ...
11 votes
1 answer
12k views

Postgres seems to ignore listen_addresses setting

I'm trying to DISABLE remote client access on my Postgres 9.5.7 database (running Ubuntu 16.04). I made what I thought are the correct changes (see below) to no avail. I can think of two reasons why ...
4 votes
2 answers
27k views

Using postgres database from another computer

I have PostgreSQL version 9.5 installed at my machine (Windows 7 Enterprise x64 bit version). I have several databases in schema 'public'. I would like to use/access one of these databases from ...
2 votes
1 answer
2k views

Cannot open `pg_hba.conf` in pgAdmin III

I am running: version ----------------------------------------------------------------------------------------------------- PostgreSQL 9.4.11 on x86_64-unknown-linux-gnu, compiled by gcc (Ubuntu 4.8....
0 votes
1 answer
820 views

Reset postgres password v9.1 [closed]

I'm trying to reset my lost password for Postgres v9.1 (windows 7) like written at https://wiki.postgresql.org/wiki/FAQ#I_lost_the_database_password._What_can_I_do_to_recover_it.3F : 1. edit pg_hba....
4 votes
2 answers
7k views

Postgresql pg_hba.conf changes are ignored or not loaded

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. ...
4 votes
1 answer
1k views

I Need Help Setting Up Roles and Passwords in PostgreSQL

I'm using the postgres.app on my Mac Mini Server running version 9.4.0 using El Capitan. I have not done any customization in pg-hba.conf. I do not have a .pgpass file. I believe that .pgpass is used ...
1 vote
1 answer
4k views

For PostgreSQL database, restrict remote connections to password

I have recently set-up a PostgreSQL database on client's CentOs machine. Until now the remote access was restricted. Now I have tried to open the remote connections for us, with following entry in ...
4 votes
1 answer
3k views

postgresql - a local replication entry doesn't work

Maybe it's just too early in the morning, but I can't seem to get pg_basebackup working for a local user. This is part of testing for an hourly backup automated script. I added a line to pg_hba.conf ...
1 vote
2 answers
5k views

Access to database denied :ELEPHANTSQL on Bluemix - “No pg_hba.conf entry for host localhost, user ADMIN, database SYSTEM”

While trying to connect to my ElephantSQL database on Bluemix using pgadmin, it throws the following error. Access to database denied The server doesn't grant access to the database: the server ...
0 votes
1 answer
329 views

Can duplicate pg_hba entries result in a connection error?

I have received the following error when attempting to connect to an Arch Linux server: Sequel::DatabaseConnectionErrorreplication#monitor PG::Error: could not connect to server: Connection refused ...