@@ -457,16 +457,29 @@ hostnossl <replaceable>database</replaceable> <replaceable>user</replaceable>
457
457
<term><literal>ident</></term>
458
458
<listitem>
459
459
<para>
460
- Obtain the operating system user name of the client (for
461
- TCP/IP connections by contacting the ident server on the
462
- client, for local connections by getting it from the
463
- operating system) and check if it matches the requested
464
- database user name.
460
+ Obtain the operating system user name of the client
461
+ by contacting the ident server on the client
462
+ and check if it matches the requested database user name.
463
+ Ident authentication can only be used on TCP/IP
464
+ connections. When specified for local connections, peer
465
+ authentication will be used instead.
465
466
See <xref linkend="auth-ident"> for details.
466
467
</para>
467
468
</listitem>
468
469
</varlistentry>
469
470
471
+ <varlistentry>
472
+ <term><literal>peer</></term>
473
+ <listitem>
474
+ <para>
475
+ Obtain the operating system user name from the operating system
476
+ and check if it matches the requested database user name.
477
+ This is only available for local connections.
478
+ See <xref linkend="auth-peer"> for details.
479
+ </para>
480
+ </listitem>
481
+ </varlistentry>
482
+
470
483
<varlistentry>
471
484
<term><literal>ldap</></term>
472
485
<listitem>
@@ -1200,21 +1213,27 @@ omicron bryanh guest1
1200
1213
</sect2>
1201
1214
1202
1215
<sect2 id="auth-ident">
1203
- <title>Ident-based Authentication</title>
1216
+ <title>Ident Authentication</title>
1204
1217
1205
1218
<indexterm>
1206
1219
<primary>ident</primary>
1207
1220
</indexterm>
1208
1221
1209
1222
<para>
1210
1223
The ident authentication method works by obtaining the client's
1211
- operating system user name and using it as the allowed database user
1212
- name (with an optional user name mapping).
1213
- The determination of the client's
1214
- user name is the security-critical point, and it works differently
1215
- depending on the connection type, as described below.
1224
+ operating system user name from an ident server and using it as
1225
+ the allowed database user name (with an optional user name mapping).
1226
+ This is only supported on TCP/IP connections.
1216
1227
</para>
1217
1228
1229
+ <note>
1230
+ <para>
1231
+ When ident is specified for a local (non-TCP/IP) connection,
1232
+ peer authentication (see <xref linkend="auth-peer">) will be
1233
+ used instead.
1234
+ </para>
1235
+ </note>
1236
+
1218
1237
<para>
1219
1238
The following configuration options are supported for <productname>ident</productname>:
1220
1239
<variablelist>
@@ -1230,9 +1249,6 @@ omicron bryanh guest1
1230
1249
</variablelist>
1231
1250
</para>
1232
1251
1233
- <sect3>
1234
- <title>Ident Authentication Over TCP/IP</title>
1235
-
1236
1252
<para>
1237
1253
The <quote>Identification Protocol</quote> is described in
1238
1254
RFC 1413. Virtually every Unix-like
@@ -1275,36 +1291,48 @@ omicron bryanh guest1
1275
1291
since <productname>PostgreSQL</> does not have any way to decrypt the
1276
1292
returned string to determine the actual user name.
1277
1293
</para>
1278
- </sect3 >
1294
+ </sect2 >
1279
1295
1280
- <sect3>
1281
- <title>Ident Authentication Over Local Sockets</title>
1296
+ <sect2 id="auth-peer">
1297
+ <title>Peer Authentication</title>
1298
+
1299
+ <indexterm>
1300
+ <primary>peer</primary>
1301
+ </indexterm>
1282
1302
1283
1303
<para>
1284
- On systems supporting <symbol>SO_PEERCRED</symbol> requests for
1304
+ The peer authentication method works by obtaining the client's
1305
+ operating system user name from the kernel and using it as the
1306
+ allowed database user name (with optional user name mapping). This
1307
+ is only supported on local connections.
1308
+ </para>
1309
+
1310
+ <para>
1311
+ The following configuration options are supported for <productname>peer</productname>:
1312
+ <variablelist>
1313
+ <varlistentry>
1314
+ <term><literal>map</literal></term>
1315
+ <listitem>
1316
+ <para>
1317
+ Allows for mapping between system and database user names. See
1318
+ <xref linkend="auth-username-maps"> for details.
1319
+ </para>
1320
+ </listitem>
1321
+ </varlistentry>
1322
+ </variablelist>
1323
+ </para>
1324
+
1325
+ <para>
1326
+ Peer authentication is only available on systems supporting
1327
+ <symbol>SO_PEERCRED</symbol> requests for
1285
1328
Unix-domain sockets (currently <systemitem
1286
1329
class="osname">Linux</>, <systemitem class="osname">FreeBSD</>,
1287
1330
<systemitem class="osname">NetBSD</>, <systemitem class="osname">OpenBSD</>,
1288
- <systemitem class="osname">BSD/OS</>, and <systemitem class="osname">Solaris</systemitem>), ident authentication can also
1289
- be applied to local connections.
1331
+ <systemitem class="osname">BSD/OS</>, and <systemitem class="osname">Solaris</systemitem>).
1290
1332
<productname>PostgreSQL</> uses <symbol>SO_PEERCRED</symbol> to find out
1291
1333
the operating system name of the connected client process.
1292
- In this case, no security risk is added by
1293
- using ident authentication; indeed it is a preferable choice for
1294
- local connections on such systems.
1295
1334
</para>
1296
1335
1297
- <para>
1298
- On systems without <symbol>SO_PEERCRED</> requests, ident
1299
- authentication is only available for TCP/IP connections. As a
1300
- work-around, it is possible to specify the <systemitem
1301
- class="systemname">localhost</> address <systemitem
1302
- class="systemname">127.0.0.1</> and make connections to this
1303
- address. This method is trustworthy to the extent that you trust
1304
- the local ident server.
1305
- </para>
1306
- </sect3>
1307
-
1308
1336
</sect2>
1309
1337
1310
1338
<sect2 id="auth-ldap">
0 commit comments