2 20.8. Ident Authentication #
4 The ident authentication method works by obtaining the client's
5 operating system user name from an ident server and using it as the
6 allowed database user name (with an optional user name mapping). This
7 is only supported on TCP/IP connections.
11 When ident is specified for a local (non-TCP/IP) connection, peer
12 authentication (see Section 20.9) will be used instead.
14 The following configuration options are supported for ident:
17 Allows for mapping between system and database user names. See
18 Section 20.2 for details.
20 The “Identification Protocol” is described in RFC 1413. Virtually every
21 Unix-like operating system ships with an ident server that listens on
22 TCP port 113 by default. The basic functionality of an ident server is
23 to answer questions like “What user initiated the connection that goes
24 out of your port X and connects to my port Y?”. Since PostgreSQL knows
25 both X and Y when a physical connection is established, it can
26 interrogate the ident server on the host of the connecting client and
27 can theoretically determine the operating system user for any given
30 The drawback of this procedure is that it depends on the integrity of
31 the client: if the client machine is untrusted or compromised, an
32 attacker could run just about any program on port 113 and return any
33 user name they choose. This authentication method is therefore only
34 appropriate for closed networks where each client machine is under
35 tight control and where the database and system administrators operate
36 in close contact. In other words, you must trust the machine running
37 the ident server. Heed the warning:
40 The Identification Protocol is not intended as an authorization or
41 access control protocol.
45 Some ident servers have a nonstandard option that causes the returned
46 user name to be encrypted, using a key that only the originating
47 machine's administrator knows. This option must not be used when using
48 the ident server with PostgreSQL, since PostgreSQL does not have any
49 way to decrypt the returned string to determine the actual user name.