Note: This solution should only be followed if md5 authentication is required for security purposes.
When postgreSQL authentication is set to trust it allows anyone to login without any user information when using a database client (pgadmin for example). This issue can be resolve by associating a password for the postgres user in the database with a password that matches the one of the shell account and remove the instructions to trust all users in the postgres configuration file. By default pgsql encrypts the password so you then can go in the pg_hba.conf, located in the postgres data directory, and removed the trust and replaced with md5. You can go an additional step and only allowed the postres user, but this is not necessary.
Note: The authentication set to trust can be changed back to md5 if required after the installation for security purposes. However, if authentication is not set to trust during the initial install of DocuShare then it will fail.
To change the authentication method:
1. Open a terminal window
2. Change into the postgres bin directory
Example: cd /usr/local/pgsql/bin
Note: Depending on your install environment the path to the bin directory may vary.
3. Type su – postgres and press Enter. This will change the logged in to the postgres user.
4. From the bin directory type ./psql
5. Type ALTER USER postgres password 'your shell account postgres password'; and press Enter. ALTER ROLE should be displayed.
6. Type \q and press Enter
7. Type vi /path to data directory/pg_hba.conf and press Enter
8. Modify the line at the bottom of the config file to resemble one of these examples.
Note: You will probably only have to change the word trust to md5. The line or lines should already exist.
host all postgres your.ip your.subnet md5
host all all your.ip your.subnet md5
Note: If you are using vi as the editor press i to insert text
9. Save the changes
Note: If you are using vi as the editor press i to insert then press :wq! to save the changes.
10. From the postgres bin directory type./pg_ctl restart -D /usr/local/pgsql/data and press Enter