Re:Securing a Postgres Database
by WaxProlix on Saturday April 03, 2021 @12:59AM
(#26678539)
To be super clear, because it can be less than perfectly obvious, this means on `localhost` but also on loopback. There is no 'real' network device talking to this port.
[ Parent
| on HN ]
it also isn't "open"; your username has to match the postgres database username to connect.
IE; the 'postgres' unix user is required to access databases as the 'postgres' database user.
Hmm I think the default pg_hba.conf uses "trust" and so will allow passwordless connections as postgres on localhost, you just have to specify the username (psql will use your username by default)
This is the case for the official docker image at least, and I'm fairly certain also true of distro package managers
At least on debian / ubuntu, the default is peer auth:
https://salsa.debian.org/postgresql/postgresql-common/-/blob...