-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauth-pg-hba-conf.html
More file actions
646 lines (643 loc) · 60.2 KB
/
auth-pg-hba-conf.html
File metadata and controls
646 lines (643 loc) · 60.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>20.1. pg_hba.confファイル</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets V1.79.1" /><link rel="prev" href="client-authentication.html" title="第20章 クライアント認証" /><link rel="next" href="auth-username-maps.html" title="20.2. ユーザ名マップ" /><meta name="viewport" content="width=device-width,initial-scale=1.0" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="4" align="center"><a accesskey="h" href="index.html">PostgreSQL 10.5文書</a></th></tr><tr><td width="10%" align="left"></td><td width="10%" align="left"></td><td width="60%" align="center"><a href="client-authentication.html" title="第20章 クライアント認証">第20章 クライアント認証</a></td><td width="20%" align="right"><div class="actions"><a class="issue" title="github" href="https://github.com/pgsql-jp/jpug-doc/issues/new?title=version 10.5 auth-pg-hba-conf.html">誤訳等の報告
</a></div></td></tr><tr><td width="10%" align="left"><a accesskey="p" href="client-authentication.html" title="第20章 クライアント認証">前へ</a> </td><td width="10%" align="left"><a accesskey="u" href="client-authentication.html" title="第20章 クライアント認証">上へ</a></td><td width="60%" align="center">20.1. <code class="filename">pg_hba.conf</code>ファイル</td><td width="20%" align="right"> <a accesskey="n" href="auth-username-maps.html" title="20.2. ユーザ名マップ">次へ</a></td></tr></table><hr /></div><div class="sect1" id="AUTH-PG-HBA-CONF"><div class="titlepage"><div><div><h2 class="title" style="clear: both">20.1. <code class="filename">pg_hba.conf</code>ファイル</h2></div></div></div><span class="original">
<title>The <filename>pg_hba.conf</filename> File</title>
</span><a id="id-1.6.7.8.2" class="indexterm"></a><p><span class="original">
Client authentication is controlled by a configuration file,
which traditionally is named
<filename>pg_hba.conf</filename> and is stored in the database
cluster's data directory.
(<acronym>HBA</> stands for host-based authentication.) A default
<filename>pg_hba.conf</filename> file is installed when the data
directory is initialized by <command>initdb</command>. It is
possible to place the authentication configuration file elsewhere,
however; see the <xref linkend="guc-hba-file"> configuration parameter.
</span>クライアント認証はデータベースクラスタのデータディレクトリ内の、伝統的に<code class="filename">pg_hba.conf</code>という名前の設定ファイルで管理されています
(<acronym class="acronym">HBA</acronym>とは、host-based authentication: ホストベース認証の略です)。
デフォルトの<code class="filename">pg_hba.conf</code>ファイルは、データディレクトリが<code class="command">initdb</code>で初期化される時にインストールされます。
しかし、この認証設定ファイルを他の場所に設置することができます。
<a class="xref" href="runtime-config-file-locations.html#GUC-HBA-FILE">hba_file</a>設定パラメータを参照してください。
</p><p><span class="original">
The general format of the <filename>pg_hba.conf</filename> file is
a set of records, one per line. Blank lines are ignored, as is any
text after the <literal>#</literal> comment character.
Records cannot be continued across lines.
A record is made
up of a number of fields which are separated by spaces and/or tabs.
Fields can contain white space if the field value is double-quoted.
Quoting one of the keywords in a database, user, or address field (e.g.,
<literal>all</> or <literal>replication</>) makes the word lose its special
meaning, and just match a database, user, or host with that name.
</span><code class="filename">pg_hba.conf</code>ファイルの一般的な書式は、1行につき1つのレコードというレコードの集合です。
空行はコメント用の<code class="literal">#</code>文字以降の文字と同じく無視されます。
レコードは行をまたいで続けることはできません。
レコードはスペースもしくはタブ、もしくはその両方で区切られた、複数のフィールドで構成されています。
フィールドには、フィールド値が二重引用符付きの場合空白文字を含むことができます。
データベース、ユーザもしくはアドレスフィールド内のキーワード(例:<code class="literal">all</code>または<code class="literal">replication</code>)の一つを引用するとその特別な意味が失われ、その名称のデータベース、ユーザもしくはホストと一致するようになります。
</p><p><span class="original">
Each record specifies a connection type, a client IP address range
(if relevant for the connection type), a database name, a user name,
and the authentication method to be used for connections matching
these parameters. The first record with a matching connection type,
client address, requested database, and user name is used to perform
authentication. There is no <quote>fall-through</> or
<quote>backup</>: if one record is chosen and the authentication
fails, subsequent records are not considered. If no record matches,
access is denied.
</span>それぞれのレコードは接続形式、(接続形式に対して意味を持つのであれば)クライアントのIPアドレス範囲、データベースの名前、ユーザ名およびこれらのパラメータに一致する接続で使用される認証方法を指定します。
接続形式、クライアントアドレス、要求されたデータベース、およびユーザ名に一致する最初のレコードが認証処理に使用されます。
<span class="quote">「<span class="quote">失敗時の継続</span>」</span>や、 あるいは<span class="quote">「<span class="quote">バックアップ</span>」</span>はありません。
これは、もしあるレコードが選択されて認証に失敗した場合、後続のレコードは考慮されないということです。
どのレコードも一致しない時はアクセスが拒否されます。
</p><p><span class="original">
A record can have one of the seven formats
</span>レコードは7つの書式のうちの1つの形式を取ります。
</p><pre class="synopsis">local <em class="replaceable"><code>database</code></em> <em class="replaceable"><code>user</code></em> <em class="replaceable"><code>auth-method</code></em> [<span class="optional"><em class="replaceable"><code>auth-options</code></em></span>]
host <em class="replaceable"><code>database</code></em> <em class="replaceable"><code>user</code></em> <em class="replaceable"><code>address</code></em> <em class="replaceable"><code>auth-method</code></em> [<span class="optional"><em class="replaceable"><code>auth-options</code></em></span>]
hostssl <em class="replaceable"><code>database</code></em> <em class="replaceable"><code>user</code></em> <em class="replaceable"><code>address</code></em> <em class="replaceable"><code>auth-method</code></em> [<span class="optional"><em class="replaceable"><code>auth-options</code></em></span>]
hostnossl <em class="replaceable"><code>database</code></em> <em class="replaceable"><code>user</code></em> <em class="replaceable"><code>address</code></em> <em class="replaceable"><code>auth-method</code></em> [<span class="optional"><em class="replaceable"><code>auth-options</code></em></span>]
host <em class="replaceable"><code>database</code></em> <em class="replaceable"><code>user</code></em> <em class="replaceable"><code>IP-address</code></em> <em class="replaceable"><code>IP-mask</code></em> <em class="replaceable"><code>auth-method</code></em> [<span class="optional"><em class="replaceable"><code>auth-options</code></em></span>]
hostssl <em class="replaceable"><code>database</code></em> <em class="replaceable"><code>user</code></em> <em class="replaceable"><code>IP-address</code></em> <em class="replaceable"><code>IP-mask</code></em> <em class="replaceable"><code>auth-method</code></em> [<span class="optional"><em class="replaceable"><code>auth-options</code></em></span>]
hostnossl <em class="replaceable"><code>database</code></em> <em class="replaceable"><code>user</code></em> <em class="replaceable"><code>IP-address</code></em> <em class="replaceable"><code>IP-mask</code></em> <em class="replaceable"><code>auth-method</code></em> [<span class="optional"><em class="replaceable"><code>auth-options</code></em></span>]</pre><p><span class="original">
The meaning of the fields is as follows:
</span>
フィールドの意味は以下のようになっています。
</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="literal">local</code></span></dt><dd><p><span class="original">
This record matches connection attempts using Unix-domain
sockets. Without a record of this type, Unix-domain socket
connections are disallowed.
</span>このレコードはUnixドメインソケットを使用する接続に対応します。
この種類のレコードを使用しないと、Unixドメインソケット経由の接続は拒否されます。
</p></dd><dt><span class="term"><code class="literal">host</code></span></dt><dd><p><span class="original">
This record matches connection attempts made using TCP/IP.
<literal>host</literal> records match either
<acronym>SSL</acronym> or non-<acronym>SSL</acronym> connection
attempts.
</span>このレコードは、TCP/IPを使用した接続に対応します。
<code class="literal">host</code>レコードは、<acronym class="acronym">SSL</acronym>もしくは非<acronym class="acronym">SSL</acronym>接続のいずれかに対応します。
</p><div class="note"><h3 class="title">注記</h3><p><span class="original">
Remote TCP/IP connections will not be possible unless
the server is started with an appropriate value for the
<xref linkend="guc-listen-addresses"> configuration parameter,
since the default behavior is to listen for TCP/IP connections
only on the local loopback address <literal>localhost</>.
</span>サーバのデフォルトの動作は、ローカルループバックアドレスである<code class="literal">localhost</code>のみTCP/IP接続を監視しています。
よってサーバにおいて<a class="xref" href="runtime-config-connection.html#GUC-LISTEN-ADDRESSES">listen_addresses</a>パラメータが適切な値に設定された状態で起動されていない限り、リモートのTCP/IP接続はできません。
</p></div></dd><dt><span class="term"><code class="literal">hostssl</code></span></dt><dd><p><span class="original">
This record matches connection attempts made using TCP/IP,
but only when the connection is made with <acronym>SSL</acronym>
encryption.
</span>このレコードは、接続が<acronym class="acronym">SSL</acronym>で暗号化されている場合にのみTCP/IPネットワークを使用する接続に対応します。
</p><p><span class="original">
To make use of this option the server must be built with
<acronym>SSL</acronym> support. Furthermore,
<acronym>SSL</acronym> must be enabled
by setting the <xref linkend="guc-ssl"> configuration parameter (see
<xref linkend="ssl-tcp"> for more information).
Otherwise, the <literal>hostssl</literal> record is ignored except for
logging a warning that it cannot match any connections.
</span>このオプションを使用するためには、サーバは<acronym class="acronym">SSL</acronym>サポートができるように構築されていなければいけません。
また、 <acronym class="acronym">SSL</acronym>は<a class="xref" href="runtime-config-connection.html#GUC-SSL">ssl</a>パラメータを設定することによりサーバの起動時に有効になっていなくてはなりません(詳細は<a class="xref" href="ssl-tcp.html" title="18.9. SSLによる安全なTCP/IP接続">18.9</a>を参照してください)。
そうでなければ、どのような接続にも対応していないという警告が表示されることを除き、<code class="literal">hostssl</code>レコードは無視されます。
</p></dd><dt><span class="term"><code class="literal">hostnossl</code></span></dt><dd><p><span class="original">
This record type has the opposite behavior of <literal>hostssl</>;
it only matches connection attempts made over
TCP/IP that do not use <acronym>SSL</acronym>.
</span>このレコードは、<code class="literal">hostssl</code>と反対の動作で、<acronym class="acronym">SSL</acronym>を使用していないTCP/IPの接続のみに対応します。
</p></dd><dt><span class="term"><em class="replaceable"><code>database</code></em></span></dt><dd><p><span class="original">
Specifies which database name(s) this record matches. The value
<literal>all</literal> specifies that it matches all databases.
The value <literal>sameuser</> specifies that the record
matches if the requested database has the same name as the
requested user. The value <literal>samerole</> specifies that
the requested user must be a member of the role with the same
name as the requested database. (<literal>samegroup</> is an
obsolete but still accepted spelling of <literal>samerole</>.)
Superusers are not considered to be members of a role for the
purposes of <literal>samerole</> unless they are explicitly
members of the role, directly or indirectly, and not just by
virtue of being a superuser.
The value <literal>replication</> specifies that the record
matches if a physical replication connection is requested (note that
replication connections do not specify any particular database).
Otherwise, this is the name of
a specific <productname>PostgreSQL</productname> database.
Multiple database names can be supplied by separating them with
commas. A separate file containing database names can be specified by
preceding the file name with <literal>@</>.
</span>このレコードで対応するデータベース名を指定します。
<code class="literal">all</code> という値は、全てのデータベースと対応することを指定します。
<code class="literal">sameuser</code>という値は、要求されたデータベースが要求ユーザと同じ名前を持つ場合にレコードが対応することを指定します。
<code class="literal">samerole</code>という値は、要求ユーザが要求されたデータベースと同じ名前のロールのメンバでなければならないことを指定します。
(以前は<code class="literal">samegroup</code>と書いていましたが、<code class="literal">samerole</code>と記述してください)
スーパーユーザは、直接的であれ間接的であれ、明示的にsameroleのメンバでない限りsameroleのメンバとはみなされません。
また、スーパーユーザであるからといって<code class="literal">samerole</code>のメンバとはみなされません。
<code class="literal">replication</code>の値は、もし物理レプリケーション接続が要求された場合(レプリケーション接続は特定のデータベースを指定しないことに注意して下さい)にレコードが一致することを指定します。
それ以外の場合には、特定の<span class="productname">PostgreSQL</span>データベースの名前になります。
データベースの名前はカンマで区切ることで複数指定できます。
データベース名を含む別のファイルを、そのファイル名の前に<code class="literal">@</code>を付けることで指定できます。
</p></dd><dt><span class="term"><em class="replaceable"><code>user</code></em></span></dt><dd><p><span class="original">
Specifies which database user name(s) this record
matches. The value <literal>all</literal> specifies that it
matches all users. Otherwise, this is either the name of a specific
database user, or a group name preceded by <literal>+</>.
(Recall that there is no real distinction between users and groups
in <productname>PostgreSQL</>; a <literal>+</> mark really means
<quote>match any of the roles that are directly or indirectly members
of this role</>, while a name without a <literal>+</> mark matches
only that specific role.) For this purpose, a superuser is only
considered to be a member of a role if they are explicitly a member
of the role, directly or indirectly, and not just by virtue of
being a superuser.
Multiple user names can be supplied by separating them with commas.
A separate file containing user names can be specified by preceding the
file name with <literal>@</>.
</span>このレコードで対応するデータベースユーザを指定します。
<code class="literal">all</code>という値は、全てのユーザが対応することを指定します。
それ以外の場合には特定のデータベースユーザの名前もしくは<code class="literal">+</code>で始まるグループ名のどちらかになります。
(<span class="productname">PostgreSQL</span>ではユーザとグループの明確な区別がないことを思い出してください。
<code class="literal">+</code>のマークは、<span class="quote">「<span class="quote">このロールの直接的もしくは間接的なメンバのどちらかに一致していること</span>」</span>を意味しています。
一方、<code class="literal">+</code>のマークのない名前は特定のロールにのみ一致します)
このため、スーパーユーザは、直接的であれ間接的であれ明示的にロールのメンバである場合にのみ、ロールのメンバとみなされます。
スーパーユーザであるからといってロールのメンバとはみなされません。
ユーザ名は、カンマで区切ることで複数指定できます。
ユーザ名を含む別のファイルを、そのファイル名の前に<code class="literal">@</code>を付けることで指定できます。
</p></dd><dt><span class="term"><em class="replaceable"><code>address</code></em></span></dt><dd><p><span class="original">
Specifies the client machine address(es) that this record
matches. This field can contain either a host name, an IP
address range, or one of the special key words mentioned below.
</span>このレコードに対応しているクライアントマシンのアドレス。
このフィールドはホスト名、IPアドレスの範囲、もしくは下記の特別なキーワードの1つを含んでいます。
</p><p><span class="original">
An IP address range is specified using standard numeric notation
for the range's starting address, then a slash (<literal>/</literal>)
and a <acronym>CIDR</> mask length. The mask
length indicates the number of high-order bits of the client
IP address that must match. Bits to the right of this should
be zero in the given IP address.
There must not be any white space between the IP address, the
<literal>/</literal>, and the CIDR mask length.
</span>IPアドレスの範囲は、範囲の開始アドレス、続いてスラッシュ(<code class="literal">/</code>)と<acronym class="acronym">CIDR</acronym>マスクの長さという標準の数値表記で指定されます。
CIDRマスク長とは、クライアントIPアドレスが一致しなければならない、高位のビット数を表すものです。
指定するIPアドレスのこれより右側のビットには、0を指定しなければなりません。
IPアドレスと<code class="literal">/</code>、およびCIDRマスク長の間には空白を入れてはいけません。
</p><p><span class="original">
Typical examples of an IPv4 address range specified this way are
<literal>172.20.143.89/32</literal> for a single host, or
<literal>172.20.143.0/24</literal> for a small network, or
<literal>10.6.0.0/16</literal> for a larger one.
An IPv6 address range might look like <literal>::1/128</literal>
for a single host (in this case the IPv6 loopback address) or
<literal>fe80::7a31:c1ff:0000:0000/96</literal> for a small
network.
<literal>0.0.0.0/0</literal> represents all
IPv4 addresses, and <literal>::0/0</literal> represents
all IPv6 addresses.
To specify a single host, use a mask length of 32 for IPv4 or
128 for IPv6. In a network address, do not omit trailing zeroes.
</span>典型的なIPv4アドレス範囲の例は、単一のホストでは<code class="literal">172.20.143.89/32</code>、小規模ネットワークでは<code class="literal">172.20.143.0/24</code>、大規模ネットワークでは<code class="literal">10.6.0.0/16</code>のようなものです。
IPv6アドレスの範囲は、単一のホストでは<code class="literal">::1/128</code>(この場合はIPv6ループバックアドレス)、小規模ネットワークでは<code class="literal">fe80::7a31:c1ff:0000:0000/96</code>のようなものです。
<code class="literal">0.0.0.0/0</code>は全てのIPv4アドレスを意味します。また、<code class="literal">::0/0</code>は全てのIPv6アドレスを意味しています。
単一ホストを指定するには、IPv4では32、IPv6では128というマスク長を使用してください。
ネットワークアドレスでは末尾の0を省略できません。
</p><p><span class="original">
An entry given in IPv4 format will match only IPv4 connections,
and an entry given in IPv6 format will match only IPv6 connections,
even if the represented address is in the IPv4-in-IPv6 range.
Note that entries in IPv6 format will be rejected if the system's
C library does not have support for IPv6 addresses.
</span>IPv4書式で与えられたエントリは、IPv4接続のみに対応し、IPv6書式で与えられた項目は、たとえそのアドレスがIPv6内のIPv4の範囲内であったとしてもIPv6接続のみに対応します。
IPv6書式の項目は、システムのCライブラリがIPv6アドレスをサポートしていない場合拒絶されることに注意してください。
</p><p><span class="original">
You can also write <literal>all</literal> to match any IP address,
<literal>samehost</literal> to match any of the server's own IP
addresses, or <literal>samenet</literal> to match any address in any
subnet that the server is directly connected to.
</span>どのIPアドレスにも一致するように<code class="literal">all</code>と書くこともできますし、
サーバ自身のどのIPアドレスにも一致するように<code class="literal">samehost</code>と書くこともできます。
もしくは、サーバが直接接続されているサブネット内のどのアドレスにも一致するように<code class="literal">samenet</code>と書くことができます。
</p><p><span class="original">
If a host name is specified (anything that is not an IP address
range or a special key word is treated as a host name),
that name is compared with the result of a reverse name
resolution of the client's IP address (e.g., reverse DNS
lookup, if DNS is used). Host name comparisons are case
insensitive. If there is a match, then a forward name
resolution (e.g., forward DNS lookup) is performed on the host
name to check whether any of the addresses it resolves to are
equal to the client's IP address. If both directions match,
then the entry is considered to match. (The host name that is
used in <filename>pg_hba.conf</filename> should be the one that
address-to-name resolution of the client's IP address returns,
otherwise the line won't be matched. Some host name databases
allow associating an IP address with multiple host names, but
the operating system will only return one host name when asked
to resolve an IP address.)
</span>もし、ホスト名(IPアドレスの範囲ではない場合の全て、もしくはホスト名として処理される特別なキーワード)が指定されている場合は、その名前は、クライアントのIPアドレスの逆引き名前解決の結果と比較されます(例えば、もしDNSが使用されている場合は逆引きDNS検索により解決されます)。
ホスト名の比較は、大文字小文字が区別されます。
もし一致するものがあった場合は、解決された、どのアドレスもクライアントのIPアドレスと等しいか否かをチェックするために(例えば、正引きDNS検索のような)ホスト名の正引き名前解決が実行されます。
もし正引き、逆引きの両方で一致した場合は、エントリは一致するものとみなされます。
(<code class="filename">pg_hba.conf</code>内で使用されているホスト名は、クライアントのIPアドレスのアドレス-名前解決が返すホスト名の1つでなければいけません。
もしそうでなければこの行は一致しません。
1つのIPアドレスを複数のホスト名に関連付けるホスト名データベースもありますが、IPアドレスの解決を要求された場合にオペレーティングシステムは1つのホスト名のみを返します。)
</p><p><span class="original">
A host name specification that starts with a dot
(<literal>.</literal>) matches a suffix of the actual host
name. So <literal>.example.com</literal> would match
<literal>foo.example.com</literal> (but not just
<literal>example.com</literal>).
</span>ドット(<code class="literal">.</code>)で始まるホスト名の特定は実際のホスト名のサフィックスに一致します。
よって、<code class="literal">.example.com</code>は、<code class="literal">foo.example.com</code>に一致します
(<code class="literal">example.com</code>だけでは一致しません)。
</p><p><span class="original">
When host names are specified
in <filename>pg_hba.conf</filename>, you should make sure that
name resolution is reasonably fast. It can be of advantage to
set up a local name resolution cache such
as <command>nscd</command>. Also, you may wish to enable the
configuration parameter <varname>log_hostname</varname> to see
the client's host name instead of the IP address in the log.
</span>ホスト名が<code class="filename">pg_hba.conf</code>内で指定されている場合、名前解決が適度に早いことを
確かめてください。<code class="command">nscd</code>のようなローカル名前解決のキャッシュを設定することによる恩恵です。
また、クライアントのIPアドレスの代わりにホスト名がログで見られるように、<code class="varname">log_hostname</code>の
設定パラメータを有効化することもできます。
</p><p><span class="original">
This field only applies to <literal>host</literal>,
<literal>hostssl</literal>, and <literal>hostnossl</> records.
</span>このフィールドは<code class="literal">host</code>および<code class="literal">hostssl</code>、<code class="literal">hostnossl</code>レコードにのみ適用されます。
</p><div class="note"><h3 class="title">注記</h3><p><span class="original">
Users sometimes wonder why host names are handled
in this seemingly complicated way, with two name resolutions
including a reverse lookup of the client's IP address. This
complicates use of the feature in case the client's reverse DNS
entry is not set up or yields some undesirable host name.
It is done primarily for efficiency: this way, a connection attempt
requires at most two resolver lookups, one reverse and one forward.
If there is a resolver problem with some address, it becomes only
that client's problem. A hypothetical alternative
implementation that only did forward lookups would have to
resolve every host name mentioned in
<filename>pg_hba.conf</filename> during every connection attempt.
That could be quite slow if many names are listed.
And if there is a resolver problem with one of the host names,
it becomes everyone's problem.
</span>時折、ユーザは、クライアントのIPアドレスの逆引きを含む2つの名前解決が必要になる、というような一見複雑に見える方法でなぜホスト名が扱われるのか不思議に思うことがあります。
このため、クライアントの逆引きDNSエントリが設定されていなかったり、いくつかの望ましくないホスト名を生成する場合にこの機能の使用が複雑になります。
これは主に効率のために行なわれます。このように、接続要求では最大2つのリゾルバの検索、1つは逆引き、1つは正引き、が必要になります。
もしリゾルバにおいて、アドレスに問題があった場合、クライアントのみの問題となります。
正引き検索のみを行うような実装を仮に行っていると、全ての接続要求において<code class="filename">pg_hba.conf</code>内に記載された全てのホスト名を解決しなくてはいけなくなります。
これは、多くの名前が列挙されていた場合にかなり遅くなります。
また、リゾルバにおいて1つのホスト名に問題があった場合、全員の問題となってしまいます。
</p><p><span class="original">
Also, a reverse lookup is necessary to implement the suffix
matching feature, because the actual client host name needs to
be known in order to match it against the pattern.
</span>さらに、逆引き検索はサフィックス一致の機能を実装するために必要です。というのも実際のクライアントのホスト名は
ホスト名がパターンに対して一致するために、知られる必要があるためです。
</p><p><span class="original">
Note that this behavior is consistent with other popular
implementations of host name-based access control, such as the
Apache HTTP Server and TCP Wrappers.
</span>このふるまいは、Apache HTTPサーバやTCPラッパーのような他のよくあるホスト名ベースのアクセス制御の実装と
一致していることに注意して下さい。
</p></div></dd><dt><span class="term"><em class="replaceable"><code>IP-address</code></em><br /></span><span class="term"><em class="replaceable"><code>IP-mask</code></em></span></dt><dd><p><span class="original">
These two fields can be used as an alternative to the
<replaceable>IP-address</><literal>/</><replaceable>mask-length</>
notation. Instead of
specifying the mask length, the actual mask is specified in a
separate column. For example, <literal>255.0.0.0</> represents an IPv4
CIDR mask length of 8, and <literal>255.255.255.255</> represents a
CIDR mask length of 32.
</span>この2つのフィールドは<em class="replaceable"><code>IP-address</code></em><code class="literal">/</code><em class="replaceable"><code>mask-length</code></em>表記の代替として使用可能です。
マスク長を指定する代わりに、実際のマスクを分離した列で指定します。
例えば<code class="literal">255.0.0.0</code>はIPv4のCIDRマスク長8を意味し、<code class="literal">255.255.255.255</code>はCIDRマスク長32を意味しています。
</p><p><span class="original">
These fields only apply to <literal>host</literal>,
<literal>hostssl</literal>, and <literal>hostnossl</> records.
</span>このフィールドは<code class="literal">host</code>および<code class="literal">hostssl</code>、<code class="literal">hostnossl</code>レコードにのみ適用されます。
</p></dd><dt><span class="term"><em class="replaceable"><code>auth-method</code></em></span></dt><dd><p><span class="original">
Specifies the authentication method to use when a connection matches
this record. The possible choices are summarized here; details
are in <xref linkend="auth-methods">.
</span>接続がこのレコードに一致する場合に使用する認証方式を指定します。
使用できる選択肢は以下にまとめていますが、詳しくは<a class="xref" href="auth-methods.html" title="20.3. 認証方式">20.3</a>を参照してください。
</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="literal">trust</code></span></dt><dd><p><span class="original">
Allow the connection unconditionally. This method
allows anyone that can connect to the
<productname>PostgreSQL</productname> database server to login as
any <productname>PostgreSQL</productname> user they wish,
without the need for a password or any other authentication. See <xref
linkend="auth-trust"> for details.
</span>接続を無条件で許可します。
この方式は、<span class="productname">PostgreSQL</span>データベースサーバに接続できる全てのユーザが、任意の<span class="productname">PostgreSQL</span>ユーザとしてパスワードや他の認証なしでログインすることを許可します。
詳細は<a class="xref" href="auth-methods.html#AUTH-TRUST" title="20.3.1. trust認証">20.3.1</a>を参照してください。
</p></dd><dt><span class="term"><code class="literal">reject</code></span></dt><dd><p><span class="original">
Reject the connection unconditionally. This is useful for
<quote>filtering out</> certain hosts from a group, for example a
<literal>reject</> line could block a specific host from connecting,
while a later line allows the remaining hosts in a specific
network to connect.
</span>接続を無条件に拒否します。
特定のホストをあるグループから<span class="quote">「<span class="quote">除外</span>」</span>するために便利です。
例えば、1行の<code class="literal">reject</code>は特定のホストが接続することを拒否します。一方、
後ろの行では特定のネットワーク内の残りのホストが接続することを許可します。
</p></dd><dt><span class="term"><code class="literal">scram-sha-256</code></span></dt><dd><p><span class="original">
Perform SCRAM-SHA-256 authentication to verify the user's
password. See <xref linkend="auth-password"> for details.
</span>ユーザのパスワードを検証するためにSCRAM-SHA-256認証を実行します。
詳細は<a class="xref" href="auth-methods.html#AUTH-PASSWORD" title="20.3.2. パスワード認証">20.3.2</a>をご覧ください。
</p></dd><dt><span class="term"><code class="literal">md5</code></span></dt><dd><p><span class="original">
Perform SCRAM-SHA-256 or MD5 authentication to verify the
user's password. See <xref linkend="auth-password">
for details.
</span>ユーザのパスワードを検証するために、SCRAM-SHA-256あるいはMD5認証を実行します。
詳細は<a class="xref" href="auth-methods.html#AUTH-PASSWORD" title="20.3.2. パスワード認証">20.3.2</a>を参照してください。
</p></dd><dt><span class="term"><code class="literal">password</code></span></dt><dd><p><span class="original">
Require the client to supply an unencrypted password for
authentication.
Since the password is sent in clear text over the
network, this should not be used on untrusted networks.
See <xref linkend="auth-password"> for details.
</span>クライアントに対して認証時に平文のパスワードを要求します。
パスワードはネットワークを通じて普通のテキスト形式で送られますので、信頼されていないネットワークでは使用しないでください。
詳細は<a class="xref" href="auth-methods.html#AUTH-PASSWORD" title="20.3.2. パスワード認証">20.3.2</a>を参照してください。
</p></dd><dt><span class="term"><code class="literal">gss</code></span></dt><dd><p><span class="original">
Use GSSAPI to authenticate the user. This is only
available for TCP/IP connections. See <xref
linkend="gssapi-auth"> for details.
</span>ユーザの認証にGSSAPIを使用します。
これはTCP/IP接続を使用するときのみ使用可能です。
詳細は<a class="xref" href="auth-methods.html#GSSAPI-AUTH" title="20.3.3. GSSAPI認証">20.3.3</a>を参照してください。
</p></dd><dt><span class="term"><code class="literal">sspi</code></span></dt><dd><p><span class="original">
Use SSPI to authenticate the user. This is only
available on Windows. See <xref
linkend="sspi-auth"> for details.
</span>ユーザの認証にSSPIを使用します。
これはWindowsを使用するときのみ使用可能です。
詳細は<a class="xref" href="auth-methods.html#SSPI-AUTH" title="20.3.4. SSPI認証">20.3.4</a>を参照してください。
</p></dd><dt><span class="term"><code class="literal">ident</code></span></dt><dd><p><span class="original">
Obtain the operating system user name of the client
by contacting the ident server on the client
and check if it matches the requested database user name.
Ident authentication can only be used on TCP/IP
connections. When specified for local connections, peer
authentication will be used instead.
See <xref linkend="auth-ident"> for details.
</span>クライアントのオペレーティングシステムにおけるユーザ名をクライアント上のidentサーバに尋ねてユーザ名が要求されたデータベースユーザ名と一致するか検査します。
ident認証は、TCP/IP接続でのみ使用可能です。ローカル接続が指定されている場合は、peer認証が代わりに使用されます。
詳細は<a class="xref" href="auth-methods.html#AUTH-IDENT" title="20.3.5. Ident認証">20.3.5</a>を参照してください。
</p></dd><dt><span class="term"><code class="literal">peer</code></span></dt><dd><p><span class="original">
Obtain the client's operating system user name from the operating
system and check if it matches the requested database user name.
This is only available for local connections.
See <xref linkend="auth-peer"> for details.
</span>クライアントのオペレーティングシステムにおけるユーザ名をオペレーティングシステムから取得し、ユーザ名が要求されたデータベースユーザ名と一致するか検査します。
これはローカル接続の時にのみ使用可能です。詳細は<a class="xref" href="auth-methods.html#AUTH-PEER" title="20.3.6. Peer認証">20.3.6</a>を参照してください。
</p></dd><dt><span class="term"><code class="literal">ldap</code></span></dt><dd><p><span class="original">
Authenticate using an <acronym>LDAP</> server. See <xref
linkend="auth-ldap"> for details.
</span><acronym class="acronym">LDAP</acronym>サーバを使用して認証します。
詳細は<a class="xref" href="auth-methods.html#AUTH-LDAP" title="20.3.7. LDAP認証">20.3.7</a>を参照してください。
</p></dd><dt><span class="term"><code class="literal">radius</code></span></dt><dd><p><span class="original">
Authenticate using a RADIUS server. See <xref
linkend="auth-radius"> for details.
</span>RADIUSサーバを使用して認証します。
詳細は<a class="xref" href="auth-methods.html#AUTH-RADIUS" title="20.3.8. RADIUS認証">20.3.8</a>を参照してください。
</p></dd><dt><span class="term"><code class="literal">cert</code></span></dt><dd><p><span class="original">
Authenticate using SSL client certificates. See
<xref linkend="auth-cert"> for details.
</span>SSLクライアント証明書を使用して認証します。
詳細は<a class="xref" href="auth-methods.html#AUTH-CERT" title="20.3.9. 証明書認証">20.3.9</a>を参照してください。
</p></dd><dt><span class="term"><code class="literal">pam</code></span></dt><dd><p><span class="original">
Authenticate using the Pluggable Authentication Modules
(PAM) service provided by the operating system. See <xref
linkend="auth-pam"> for details.
</span>オペレーティングシステムによって提供されるPAM(Pluggable Authentication Modules)サービスを使用した認証です。
詳細は<a class="xref" href="auth-methods.html#AUTH-PAM" title="20.3.10. PAM認証">20.3.10</a>を参照してください。
</p></dd><dt><span class="term"><code class="literal">bsd</code></span></dt><dd><p><span class="original">
Authenticate using the BSD Authentication service provided by the
operating system. See <xref linkend="auth-bsd"> for details.
</span>オペレーティングシステムによって提供されたBSD認証サービスを使用して認証します。
詳細は<a class="xref" href="auth-methods.html#AUTH-BSD" title="20.3.11. BSD認証">20.3.11</a>を参照してください。
</p></dd></dl></div><p>
</p></dd><dt><span class="term"><em class="replaceable"><code>auth-options</code></em></span></dt><dd><p><span class="original">
After the <replaceable>auth-method</> field, there can be field(s) of
the form <replaceable>name</><literal>=</><replaceable>value</> that
specify options for the authentication method. Details about which
options are available for which authentication methods appear below.
</span><em class="replaceable"><code>auth-method</code></em>フィールドの後ろに、
認証方式のオプションを指定する、<em class="replaceable"><code>name</code></em><code class="literal">=</code><em class="replaceable"><code>value</code></em>の形式のフィールドが存在する可能性があります。
どのオプションがどの認証方式に使用できるのか、についての詳細は以下で説明します。
</p><p><span class="original">
In addition to the method-specific options listed below, there is one
method-independent authentication option <literal>clientcert</>, which
can be specified in any <literal>hostssl</> record. When set
to <literal>1</>, this option requires the client to present a valid
(trusted) SSL certificate, in addition to the other requirements of the
authentication method.
</span>以下に示された方式特定のオプションに加えて、方式に依存しないのひとつの認証オプション<code class="literal">clientcert</code>があり、<code class="literal">hostssl</code>レコードで指定することができます。
オプションを<code class="literal">1</code>にセットした時、このオプションはその認証方式で必要な他の事項を要求することに加えて、クライアントに有効な(信頼された)SSL証明書の提出を要求します。
</p></dd></dl></div><p>
</p><p><span class="original">
Files included by <literal>@</> constructs are read as lists of names,
which can be separated by either whitespace or commas. Comments are
introduced by <literal>#</literal>, just as in
<filename>pg_hba.conf</filename>, and nested <literal>@</> constructs are
allowed. Unless the file name following <literal>@</> is an absolute
path, it is taken to be relative to the directory containing the
referencing file.
</span><code class="literal">@</code>式により含められるファイルは、空白文字あるいはカンマのどちらかで区切られた名前の列挙として読み込まれます。
コメントは、<code class="filename">pg_hba.conf</code>と同様に<code class="literal">#</code>から始まります。
また、<code class="literal">@</code>式を入れ子にすることもできます。
<code class="literal">@</code>の後のファイル名が絶対パスでない限り、参照元ファイルが存在するディレクトリから見た相対パスであるとみなされます。
</p><p><span class="original">
Since the <filename>pg_hba.conf</filename> records are examined
sequentially for each connection attempt, the order of the records is
significant. Typically, earlier records will have tight connection
match parameters and weaker authentication methods, while later
records will have looser match parameters and stronger authentication
methods. For example, one might wish to use <literal>trust</>
authentication for local TCP/IP connections but require a password for
remote TCP/IP connections. In this case a record specifying
<literal>trust</> authentication for connections from 127.0.0.1 would
appear before a record specifying password authentication for a wider
range of allowed client IP addresses.
</span><code class="filename">pg_hba.conf</code>レコードは接続が試みられる度に順番に検査されますので、レコードの順序はとても大切です。
典型的には、始めの方のレコードには厳しい接続照合パラメータと緩い認証方式があるのに対し、終わりの方のレコードにはより緩い照合パラメータとより厳しい認証方式があります。
例えば、ローカルTCP接続では<code class="literal">trust</code>認証方式、リモートTCP接続に対してはパスワードを要求したいとします。
この場合、広範囲にわたって許可されるクライアントのIPアドレスに対するパスワード認証を指定するレコードの前に127.0.0.1からの接続に対する<code class="literal">trust</code>認証指定のレコードが置かれなければなりません。
</p><p><span class="original">
The <filename>pg_hba.conf</filename> file is read on start-up and when
the main server process receives a
<systemitem>SIGHUP</systemitem><indexterm><primary>SIGHUP</primary></indexterm>
signal. If you edit the file on an
active system, you will need to signal the postmaster
(using <literal>pg_ctl reload</> or <literal>kill -HUP</>) to make it
re-read the file.
</span><code class="filename">pg_hba.conf</code>ファイルは起動時と、主サーバプロセスが<span class="systemitem">SIGHUP</span>シグナルを受け取った時に読み込まれます。<a id="id-1.6.7.8.9.3" class="indexterm"></a>
稼働中のシステムでファイルを編集した場合は、(<code class="literal">pg_ctl reload</code>あるいは<code class="literal">kill -HUP</code>を使用して)postmasterにファイルをもう一度読み込むようにシグナルを出さなければなりません。
</p><div class="note"><h3 class="title">注記</h3><p><span class="original">
The preceding statement is not true on Microsoft Windows: there, any
changes in the <filename>pg_hba.conf</filename> file are immediately
applied by subsequent new connections.
</span>上記はマイクロソフトWindowsに対しては当てはまりません。
つまり、<code class="filename">pg_hba.conf</code>に対する変更は、ただちにそれ以降の新しい接続に反映されます。
</p></div><p><span class="original">
The system view
<link linkend="view-pg-hba-file-rules"><structname>pg_hba_file_rules</structname></link>
can be helpful for pre-testing changes to the <filename>pg_hba.conf</>
file, or for diagnosing problems if loading of the file did not have the
desired effects. Rows in the view with
non-null <structfield>error</structfield> fields indicate problems in the
corresponding lines of the file.
</span><code class="filename">pg_hba.conf</code>に対する変更をテストする際、あるいはそのファイルをロードしても期待していた結果が得られなかった場合には、
システムビュー<a class="link" href="view-pg-hba-file-rules.html" title="51.71. pg_hba_file_rules"><code class="structname">pg_hba_file_rules</code></a>が役に立ちます。
そのビューの<code class="structfield">error</code>フィールドがNULLでない行は、そのファイルの該当行に問題があることを示しています。
</p><div class="tip"><h3 class="title">ヒント</h3><p><span class="original">
To connect to a particular database, a user must not only pass the
<filename>pg_hba.conf</filename> checks, but must have the
<literal>CONNECT</> privilege for the database. If you wish to
restrict which users can connect to which databases, it's usually
easier to control this by granting/revoking <literal>CONNECT</> privilege
than to put the rules in <filename>pg_hba.conf</filename> entries.
</span>特定のデータベースに接続するためには、ユーザは<code class="filename">pg_hba.conf</code>による検査を通過しなければならない他、そのデータベースに対する<code class="literal">CONNECT</code>権限を持たなければなりません。
どのユーザがどのデータベースに接続できるかを制限したければ、通常、<code class="filename">pg_hba.conf</code>項目に規則を追加するよりも、<code class="literal">CONNECT</code>権限の付与・削除を行う方が簡単です。
</p></div><p><span class="original">
Some examples of <filename>pg_hba.conf</filename> entries are shown in
<xref linkend="example-pg-hba.conf">. See the next section for details on the
different authentication methods.
</span><code class="filename">pg_hba.conf</code>ファイルの例をいくつか<a class="xref" href="auth-pg-hba-conf.html#EXAMPLE-PG-HBA.CONF" title="例20.1 pg_hba.confの項目の例">例 20.1</a>に示します。
各種認証方式の詳細についてはその後で説明します。
</p><div class="example" id="EXAMPLE-PG-HBA.CONF"><p class="title"><strong>例20.1 <code class="filename">pg_hba.conf</code>の項目の例</strong></p><div class="example-contents"><span class="original">
<title>Example <filename>pg_hba.conf</filename> Entries</title>
</span><pre class="programlisting"><span class="original">
# Allow any user on the local system to connect to any database with
# any database user name using Unix-domain sockets (the default for local
# connections).
</span># ローカルシステム上の全てのユーザが、任意のデータベースに
# 任意のデータベースユーザ名でUnixドメインソケットを使用して接続することを許可
# (ローカル接続ではデフォルト)。
#
# TYPE DATABASE USER ADDRESS METHOD
local all all trust
<span class="original">
# The same using local loopback TCP/IP connections.
</span>
# 上記と同じことをローカルループバックのTCP/IP接続を使って行なう。
#
# TYPE DATABASE USER ADDRESS METHOD
host all all 127.0.0.1/32 trust
<span class="original">
# The same as the previous line, but using a separate netmask column
</span>
# 上記と同じだが、独立したネットマスク列を使用する
#
# TYPE DATABASE USER IP-ADDRESS IP-MASK METHOD
host all all 127.0.0.1 255.255.255.255 trust
<span class="original">
# The same over IPv6.
</span>
# IPv6で上記と同じことを行なう。
#
# TYPE DATABASE USER ADDRESS METHOD
host all all ::1/128 trust
<span class="original">
# The same using a host name (would typically cover both IPv4 and IPv6).
</span>
# ホスト名を使用して上記と同じことを行なう(通常はIPv4とIPv6の両方をカバーします)。
#
# TYPE DATABASE USER ADDRESS METHOD
host all all localhost trust
<span class="original">
# Allow any user from any host with IP address 192.168.93.x to connect
# to database "postgres" as the same user name that ident reports for
# the connection (typically the operating system user name).
</span>
# IPアドレス192.168.93.xを持つ全てのホストの全てのユーザが、
# identがその接続について報告するのと同じユーザ名(典型的にはオペレーティングシステムのユーザ名)で
# データベース「postgres」へ接続することを許可。
#
# TYPE DATABASE USER ADDRESS METHOD
host postgres all 192.168.93.0/24 ident
<span class="original">
# Allow any user from host 192.168.12.10 to connect to database
# "postgres" if the user's password is correctly supplied.
</span>
# ユーザのパスワードが正しく入力された場合、
# ホスト192.168.12.10からのどのようなユーザでもデータベース「postgres」へ接続することを許可。
#
# TYPE DATABASE USER ADDRESS METHOD
host postgres all 192.168.12.10/32 scram-sha-256
<span class="original">
# Allow any user from hosts in the example.com domain to connect to
# any database if the user's password is correctly supplied.
</span>
# ユーザのパスワードが正しく指定された場合は、
# example.comドメイン内のホストからの、どのユーザからのデータベース接続も許可する。
#
# Require SCRAM authentication for most users, but make an exception
# for user 'mike', who uses an older client that doesn't support SCRAM
# authentication.
#
# TYPE DATABASE USER ADDRESS METHOD
host all mike .example.com md5
host all all .example.com scram-sha-256
<span class="original">
# In the absence of preceding "host" lines, these two lines will
# reject all connections from 192.168.54.1 (since that entry will be
# matched first), but allow GSSAPI connections from anywhere else
# on the Internet. The zero mask causes no bits of the host IP
# address to be considered, so it matches any host.
</span>
# 先行する「host」行がなければ、これら2行によって192.168.54.1からの接続
# の試みを全て拒否(この項目が最初に照合されるため)。
# ただし、インターネット上の他の全ての場所からのGSSAPI接続は許可。
# ゼロマスクは、ホストIPアドレスのビットが考慮されずに
# どのホストでも照合できることになる。
#
# TYPE DATABASE USER ADDRESS METHOD
host all all 192.168.54.1/32 reject
host all all 0.0.0.0/0 gss
<span class="original">
# Allow users from 192.168.x.x hosts to connect to any database, if
# they pass the ident check. If, for example, ident says the user is
# "bryanh" and he requests to connect as PostgreSQL user "guest1", the
# connection is allowed if there is an entry in pg_ident.conf for map
# "omicron" that says "bryanh" is allowed to connect as "guest1".
</span>
# 192.168.x.xホストからのユーザが、ident検査に通る場合、
# どのデータベースにでも接続を許可。もし、例えば、identが「bryanh」と認定し
# 「bryanh」がPostgreSQLのユーザ「guest1」として
# 接続要求を出す場合、「bryanh」は「guest1」として接続が許可されるという
# マップ「omicron」に対する記載事項がpg_ident.confにあれば接続を許可。
#
# TYPE DATABASE USER ADDRESS METHOD
host all all 192.168.0.0/16 ident map=omicron
<span class="original">
# If these are the only three lines for local connections, they will
# allow local users to connect only to their own databases (databases
# with the same name as their database user name) except for administrators
# and members of role "support", who can connect to all databases. The file
# $PGDATA/admins contains a list of names of administrators. Passwords
# are required in all cases.
</span>
# ローカル接続に対して、以下のたった3行しか記載がない場合、ローカルユーザは
# 自分のデータベース(データベースユーザ名と同じ名前のデータベース)にのみ接続許可。
# ただし管理者とロール「support」のメンバは全てのデータベースに接続可能。
# $PGDATA/adminsファイルは管理者のリストを含む。
# 全ての場合にパスワードが必要。
#
# TYPE DATABASE USER ADDRESS METHOD
local sameuser all md5
local all @admins md5
local all +support md5
<span class="original">
# The last two lines above can be combined into a single line:
</span>
# 上記の最後の2行は1つの行にまとめることが可能。
local all @admins,+support md5
<span class="original">
# The database column can also use lists and file names:
</span>
# データベースの列にはリストやファイル名も使用できる。
local db1,db2,@demodbs all md5</pre></div></div><br class="example-break" /></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="client-authentication.html">前へ</a> </td><td width="20%" align="center"><a accesskey="u" href="client-authentication.html">上へ</a></td><td width="40%" align="right"> <a accesskey="n" href="auth-username-maps.html">次へ</a></td></tr><tr><td width="40%" align="left" valign="top">第20章 クライアント認証 </td><td width="20%" align="center"><a accesskey="h" href="index.html">ホーム</a></td><td width="40%" align="right" valign="top"> 20.2. ユーザ名マップ</td></tr></table></div></body></html>