Couldn't find postgresql.conf & pg_hba.conf files in my postgresql installation

If you type the following:

sudo su - postgres

after installing postgresql-server, that should take you right to the home directory of postgres and will have the configuration files you are looking for. Usually in a RHEL environment, the configuration files would be stored in /var/lib/pgsql/. On my test environment it is stored in /var/lib/pgsql/9.1/data.

Use linux command locate (Docs:

[[email protected] pgsql]# locate pg_hba.conf

I am in CenOS 7, locate is not installed by default. Similar to the answer above, but run with show cmd below:

psql -U postgres -c 'show config_file'

And find the files are in /data/pgdata/postgresql.conf.