Authentication in PostgreSQL
Authentication answers the question: who is the user? PostgreSQL supports several authentication methods, including
- trust: anyone who can connect to the server is authorized to access the database / databases as specified in the
pg_hba.conf
configuration file. Often used to allow connection using Unix-domain socket on a single user machine to access the database. One can also use this method with TCP/IP , but it is rare to allow connection from any IP address other than localhost. - ident: it works by getting the client's operating system user name from an ident server and then using it in accessing the database server. This method is recommend only for closed networks where client machines has a tight control by system administrators.
- peer: it works similar to ident, but the client's operating system user name is obtained from the kernel.
- GSSAPI: GSSAPI is an industry standard defined in RFC 2743, it provides automatic authentication (single sign-on).
- LDAP: LDAP ...