-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauth-trust.html
More file actions
63 lines (63 loc) · 8.24 KB
/
auth-trust.html
File metadata and controls
63 lines (63 loc) · 8.24 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
<?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.4. Trust認証</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="prev" href="auth-methods.html" title="20.3. 認証方式" /><link rel="next" href="auth-password.html" title="20.5. パスワード認証" /><meta name="viewport" content="width=device-width,initial-scale=1.0" /></head><body id="docContent" class="container-fluid col-10"><div class="other_version"><a href="https://www.postgresql.jp/document/">バージョンごとのドキュメント一覧</a></div><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="4" align="center"><a accesskey="h" href="index.html">PostgreSQL 18.3文書</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?template=bug_report.yml&what-happened=version 18.3 : auth-trust.html">誤訳等の報告
</a></div></td></tr><tr><td width="10%" align="left"><a accesskey="p" href="auth-methods.html" title="20.3. 認証方式">前へ</a> </td><td width="10%" align="left"><a accesskey="u" href="client-authentication.html" title="第20章 クライアント認証">上へ</a></td><td width="60%" align="center">20.4. Trust認証</td><td width="20%" align="right"> <a accesskey="n" href="auth-password.html" title="20.5. パスワード認証">次へ</a></td></tr></table><hr /></div><div class="sect1" id="AUTH-TRUST"><div class="titlepage"><div><div><h2 class="title" style="clear: both">20.4. Trust認証 <a href="#AUTH-TRUST" class="id_link">#</a></h2></div></div></div><span class="original">
<title>Trust Authentication</title>
</span><p>
<span class="original">
When <literal>trust</literal> authentication is specified,
<productname>PostgreSQL</productname> assumes that anyone who can
connect to the server is authorized to access the database with
whatever database user name they specify (even superuser names).
Of course, restrictions made in the <literal>database</literal> and
<literal>user</literal> columns still apply.
This method should only be used when there is adequate
operating-system-level protection on connections to the server.
</span>
<code class="literal">trust</code>認証が指定されると<span class="productname">PostgreSQL</span>は、サーバに接続できる全ての人に対して
(データベーススーパーユーザさえも)その人が指定する任意のデータベースユーザ名としてのアクセス権限が付与されていると想定します。
当然ながら<code class="literal">database</code>と<code class="literal">user</code>列にある制限は適用されます。
この方式はサーバに接続する際に適切なオペレーティングシステムレベルの保護が掛けられている場合にのみ使用すべきです。
</p><p>
<span class="original">
<literal>trust</literal> authentication is appropriate and very
convenient for local connections on a single-user workstation. It
is usually <emphasis>not</emphasis> appropriate by itself on a multiuser
machine. However, you might be able to use <literal>trust</literal> even
on a multiuser machine, if you restrict access to the server's
Unix-domain socket file using file-system permissions. To do this, set the
<varname>unix_socket_permissions</varname> (and possibly
<varname>unix_socket_group</varname>) configuration parameters as
described in <xref linkend="runtime-config-connection"/>. Or you
could set the <varname>unix_socket_directories</varname>
configuration parameter to place the socket file in a suitably
restricted directory.
</span>
<code class="literal">trust</code>認証はユーザが1人のみのワークステーション上でローカル接続を行う場合に適切で非常に便利です。
複数ユーザが存在するマシン上では一般的に適切では<span class="emphasis"><em>ありません</em></span>。
とは言っても、ファイルシステムの許可属性を使ってサーバのUnixドメインソケットファイルへのアクセスを制限すれば<code class="literal">trust</code>認証を複数ユーザのマシン上で使用することも可能です。
その方法は、<a class="xref" href="runtime-config-connection.html" title="19.3. 接続と認証">19.3</a>に記載されているように<code class="varname">unix_socket_permissions</code>(および<code class="varname">unix_socket_group</code>パラメータの可能性もあります)パラメータを設定します。
もしくは、<code class="varname">unix_socket_directories</code>設定パラメータでソケットファイルをそれに相応しく制限されているディレクトリにします。
</p><p>
<span class="original">
Setting file-system permissions only helps for Unix-socket connections.
Local TCP/IP connections are not restricted by file-system permissions.
Therefore, if you want to use file-system permissions for local security,
remove the <literal>host ... 127.0.0.1 ...</literal> line from
<filename>pg_hba.conf</filename>, or change it to a
non-<literal>trust</literal> authentication method.
</span>
ファイルシステムの許可を設定することが役に立つのはUnixソケット接続だけです。
ローカルのTCP/IP接続は、ファイルシステムにより制限はされていません。
よってローカルでファイルシステムの許可を使用したい場合は<code class="filename">pg_hba.conf</code>から
<code class="literal">host ... 127.0.0.1 ...</code>の行を削除するか、<code class="literal">trust</code>認証とは異なる方法に変更する必要があります。
</p><p>
<span class="original">
<literal>trust</literal> authentication is only suitable for TCP/IP connections
if you trust every user on every machine that is allowed to connect
to the server by the <filename>pg_hba.conf</filename> lines that specify
<literal>trust</literal>. It is seldom reasonable to use <literal>trust</literal>
for any TCP/IP connections other than those from <systemitem>localhost</systemitem> (127.0.0.1).
</span>
TCP/IP接続における<code class="literal">trust</code>認証は、<code class="literal">trust</code>を指定する<code class="filename">pg_hba.conf</code>の行によってサーバに接続を許可される全てのマシン上の全てのユーザを信用(trust)できる場合にのみ相応しいものです。
<span class="systemitem">localhost</span>(127.0.0.1)以外からのTCP/IP接続に<code class="literal">trust</code>認証を用いる理由はほとんど見当たりません。
</p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="auth-methods.html" title="20.3. 認証方式">前へ</a> </td><td width="20%" align="center"><a accesskey="u" href="client-authentication.html" title="第20章 クライアント認証">上へ</a></td><td width="40%" align="right"> <a accesskey="n" href="auth-password.html" title="20.5. パスワード認証">次へ</a></td></tr><tr><td width="40%" align="left" valign="top">20.3. 認証方式 </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 18.3文書">ホーム</a></td><td width="40%" align="right" valign="top"> 20.5. パスワード認証</td></tr></table></div></body></html>