Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Password for database user #43

Open
tonis opened this issue Mar 21, 2018 · 2 comments
Open

Password for database user #43

tonis opened this issue Mar 21, 2018 · 2 comments

Comments

@tonis
Copy link

tonis commented Mar 21, 2018

How can I set a password for the database user?

The configuration in the quick install file assumes that the postgresql user is configured with "trust" authentication in pg_hba.conf, but that's what most people would want.

@y-mori0110
Copy link
Contributor

y-mori0110 commented Mar 22, 2018

you can define PGPASSFILE to pgsql_funcs.conf and set password for database.

  1. add "export PGPASSFILE=xx" to pgsql_funcs.sql

PGHOST=localhost
PGPORT=5432
PGROLE=postgres
PGDATABASE=postgres
export PGPASSFILE=/usr/local/etc/pgpass

  1. Create pgpass file at /usr/local/etc/.
    localhost:5432:*:postgres:somepassword

  2. Grant only the read permission to the start user of zabibx agent.
    $ chmod 600 /usr/local/etc/pgpass

ref)
https://www.postgresql.org/docs/9.6/static/libpq-pgpass.html

@tonis
Copy link
Author

tonis commented Mar 22, 2018

Thank you. It would be good if you could add it to the readme or quick install file. I knew about the .pgpass file but not how to give it to zabbix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants