So I had some problems with setting up PostgreSQL on CentOS and getting a remote user working properly. Once you have it installed (install instructions on the site – also note that the service postgresql-9.3 initdb
command doesn’t work on CentOS 7 just call it manually, see the PostgreSQL wiki page).
I’ll assume you have a clean PostgreSQL database and you’ve just installed it using YUM.
– Create a new user, and give it a password.
createuser -P openfire
– Edit the pg_hba.conf
file and change the listen address to:
listen_addresses = '*'
– And edit the postgresql.conf
file and add the following line:
host openfire openfire 0.0.0.0/0 password
For me it will be over local VMware network so password in plaintext (as the password
option above implies) will be fine.
– Reboot PostgreSQL:
systemctl restart postgresql-9.3
– Finally try logging in (remember that if you don’t specify the hostname by default the Peer
connection method will be used – and you may get an error)
psql -h 172.16.145.135 -U openfire -W