I'm don't know much about database management, so to enable the remote access to my postgresql db I followed some tutorials. I've updated pg_hba_conf and postgresql_conf files.

In pg_hba_conf I added the
"host all all md5"
line in the "# IPv4 local connections" slot.

I've been succeeded for some days, but since yesterday there's a problem happening. In the computer I'm remote accessing the server, after I input the password for postgres user, PgAdmin returns "timeout expired".

enter image description here

First I've checked the server properties, and discovered that the IP inserted was not correct (what seemed strange, but I've corrected anyway). For the day it did, but today the same "timeout expired" message appeared again. The remote access settings are fine in PgAdmin, but as I checked pg_hba_conf in the server computer, it came with this settings where I've updated in first time:

"# IPv4 local connections: host all all @authmethodhost@"

Seems that it automatically removed my updated line and also altered the authentication method (as I remember, the default was "md5" and not this @authmethodhost@). I'm really confused with that.

Below I'm copying a print from the pg_hba_conf file for you to check if there's another change that I wasn't able to perceive.

enter image description here

  • Unrelated to your problem, but: please do not post text as images. The content of the pg_hba.conf should be added to your question as formatted text Oct 20 '20 at 12:20
  • 1
    You are not editing the actual pg_hba.conf used by your Postgres server - that will never contain @authmethdhost@ - what you are editing is probably some kind of template file. If you can log in through psql, use show hba_file to find the real pg_hba.conf that is being used by your Postgres server. (also: the file name is not pg_hba_conf) Oct 20 '20 at 12:21
  • Thanks! I'll search for it. And sorry about the question problem though, I'll see if I can change it Oct 20 '20 at 12:37
  • Obviously the server's IP address changes. That is odd; ask your DBA. Perhaps you can use a DNS name that is stable. Oct 20 '20 at 13:15
  • @LaurenzAlbe Yes, it has changed.. but after setting the new one I connected with no problem (at least yesterday) Sadly, there's no DBA here, I'm a new employee trying to implement a GeoDB to manage large spatial data here in the office (maybe I'm the DBA then). Oct 20 '20 at 14:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.