]> begriffs open source - ai-pg/blob - full-docs/txt/auth-trust.txt
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / txt / auth-trust.txt
1
2 20.4. Trust Authentication #
3
4    When trust authentication is specified, PostgreSQL assumes that anyone
5    who can connect to the server is authorized to access the database with
6    whatever database user name they specify (even superuser names). Of
7    course, restrictions made in the database and user columns still apply.
8    This method should only be used when there is adequate
9    operating-system-level protection on connections to the server.
10
11    trust authentication is appropriate and very convenient for local
12    connections on a single-user workstation. It is usually not appropriate
13    by itself on a multiuser machine. However, you might be able to use
14    trust even on a multiuser machine, if you restrict access to the
15    server's Unix-domain socket file using file-system permissions. To do
16    this, set the unix_socket_permissions (and possibly unix_socket_group)
17    configuration parameters as described in Section 19.3. Or you could set
18    the unix_socket_directories configuration parameter to place the socket
19    file in a suitably restricted directory.
20
21    Setting file-system permissions only helps for Unix-socket connections.
22    Local TCP/IP connections are not restricted by file-system permissions.
23    Therefore, if you want to use file-system permissions for local
24    security, remove the host ... 127.0.0.1 ... line from pg_hba.conf, or
25    change it to a non-trust authentication method.
26
27    trust authentication is only suitable for TCP/IP connections if you
28    trust every user on every machine that is allowed to connect to the
29    server by the pg_hba.conf lines that specify trust. It is seldom
30    reasonable to use trust for any TCP/IP connections other than those
31    from localhost (127.0.0.1).