简体   繁体   中英

PostgreSQL security local (pg_hba.conf )

In PostgreSQL we can just change local md5 to trust in pg_hba.conf. then we can access all data in database using psql without need of password.So anyone can change this line who can access local machine.

So, Is there way to password protect our database even someone change pg_hba.conf to trust

( I want to create offline app and need to protect client database,I need something like ms access, once we set the password it always ask for password )

As long as client has root/administrator acces on the computer you can't do much about pg_hba. You could make it read only but root can overyde anything. You could mount config file on read only file system but this is too complicated.

Solution can be only at database level(not OS or application): crypted data and triggers where you implement supplimentary security.

I don't think postresql is the answer for your requirement, maybe SQLite is the right one.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM