Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [pg-hba.conf]

The tag has no usage guidance.

169
votes
11answers
387k views

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

Hello 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", database "...
8
votes
2answers
31k 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 ...
5
votes
5answers
48k 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 ...
5
votes
1answer
5k 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 ...
5
votes
1answer
3k 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
1answer
6k 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 ...
4
votes
2answers
10k 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 ...
4
votes
1answer
698 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 ...
4
votes
1answer
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 ...
4
votes
2answers
19k 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 ...
3
votes
1answer
2k 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 ...
3
votes
1answer
853 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....
2
votes
1answer
2k 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 ...
2
votes
2answers
2k 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. ...
2
votes
1answer
58 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 ...
2
votes
1answer
123 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 ...
1
vote
3answers
259 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
2answers
2k 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 ...
1
vote
1answer
242 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 ...
1
vote
1answer
1k 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 ...
1
vote
1answer
728 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 ...
1
vote
1answer
22 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
0answers
21 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 ...
1
vote
1answer
187 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 <<...
0
votes
1answer
2k 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 ...
0
votes
1answer
8k 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
1answer
110 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 ...
0
votes
1answer
1k 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 ...
0
votes
1answer
41 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
0answers
4k 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
1answer
607 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....