@@ -11,7 +11,7 @@ $PostgreSQL: pgsql/doc/src/sgml/client-auth.sgml,v 1.82 2005/06/27 02:04:23 neil
...
@@ -11,7 +11,7 @@ $PostgreSQL: pgsql/doc/src/sgml/client-auth.sgml,v 1.82 2005/06/27 02:04:23 neil
<para>
<para>
When a client application connects to the database server, it
When a client application connects to the database server, it
specifies which <productname>PostgreSQL</productname> user name it
specifies which <productname>PostgreSQL</productname> database user name it
wants to connect as, much the same way one logs into a Unix computer
wants to connect as, much the same way one logs into a Unix computer
as a particular user. Within the SQL environment the active database
as a particular user. Within the SQL environment the active database
user name determines access privileges to database objects — see
user name determines access privileges to database objects — see
...
@@ -19,12 +19,22 @@ $PostgreSQL: pgsql/doc/src/sgml/client-auth.sgml,v 1.82 2005/06/27 02:04:23 neil
...
@@ -19,12 +19,22 @@ $PostgreSQL: pgsql/doc/src/sgml/client-auth.sgml,v 1.82 2005/06/27 02:04:23 neil
essential to restrict which database users can connect.
essential to restrict which database users can connect.
</para>
</para>
<note>
<para>
As explained in <xref linkend="user-manag">,
<productname>PostgreSQL</productname> actually does privilege
management in terms of <quote>roles</>. In this chapter, we
consistently use <firstterm>database user</> to mean <quote>role with the
<literal>LOGIN</> privilege</quote>.
</para>
</note>
<para>
<para>
<firstterm>Authentication</firstterm> is the process by which the
<firstterm>Authentication</firstterm> is the process by which the
database server establishes the identity of the client, and by
database server establishes the identity of the client, and by
extension determines whether the client application (or the user
extension determines whether the client application (or the user
who runs the client application) is permitted to connect with the
who runs the client application) is permitted to connect with the
user name that was requested.
database user name that was requested.
</para>
</para>
<para>
<para>
...
@@ -35,7 +45,7 @@ $PostgreSQL: pgsql/doc/src/sgml/client-auth.sgml,v 1.82 2005/06/27 02:04:23 neil
...
@@ -35,7 +45,7 @@ $PostgreSQL: pgsql/doc/src/sgml/client-auth.sgml,v 1.82 2005/06/27 02:04:23 neil
</para>
</para>
<para>
<para>
<productname>PostgreSQL</productname> user names are logically
<productname>PostgreSQL</productname> database user names are logically
separate from user names of the operating system in which the server
separate from user names of the operating system in which the server
runs. If all the users of a particular server also have accounts on
runs. If all the users of a particular server also have accounts on
the server's machine, it makes sense to assign database user names
the server's machine, it makes sense to assign database user names
...
@@ -88,13 +98,13 @@ $PostgreSQL: pgsql/doc/src/sgml/client-auth.sgml,v 1.82 2005/06/27 02:04:23 neil
...
@@ -88,13 +98,13 @@ $PostgreSQL: pgsql/doc/src/sgml/client-auth.sgml,v 1.82 2005/06/27 02:04:23 neil
<para>
<para>
A record may have one of the seven formats
A record may have one of the seven formats
<synopsis>
<synopsis>
local <replaceable>database</replaceable> <replaceable>user</replaceable> <replaceable>authentication-method</replaceable> <optional><replaceable>authentication-option</replaceable></optional>
local <replaceable>database</replaceable> <replaceable>user</replaceable> <replaceable>auth-method</replaceable> <optional><replaceable>auth-option</replaceable></optional>
<replaceable>servicename</> can be set on the server side using the
<replaceable>servicename</> can be set on the server side using the
<xref linkend="guc-krb-srvname"> configuration parameter, and on the
<xref linkend="guc-krb-srvname"> configuration parameter, and on the
client side using the krbsrvname connection parameter. (See also <xref linkend="libpq-connect">.). The installation default can be changed from the default
client side using the <literal>krbsrvname</> connection parameter. (See
<literal>postgres</literal> at build time using
also <xref linkend="libpq-connect">.) The installation default can be
<literal>./configure --with-krb-srvnam=whatever</>). In most environments,
changed from the default <literal>postgres</literal> at build time using
<literal>./configure --with-krb-srvnam=whatever</>. In most environments,
this parameter never needs to be changed. However, to support multiple
this parameter never needs to be changed. However, to support multiple
<productname>PostgreSQL</> installations on the same host it is necessary.
<productname>PostgreSQL</> installations on the same host it is necessary.
Some Kerberos implementations may also require a different service name,
Some Kerberos implementations may also require a different service name,
such as Microsoft Active Directory which requires the service name
such as Microsoft Active Directory which requires the service name
to be in uppercase (<literal>POSTGRES</literal>).
to be in uppercase (<literal>POSTGRES</literal>).
</para>
</para>
<para>
<para>
<replaceable>hostname</> is the fully qualified host name of the
<replaceable>hostname</> is the fully qualified host name of the
server machine. The service principal's realm is the preferred realm
server machine. The service principal's realm is the preferred realm
...
@@ -641,7 +662,7 @@ local db1,db2,@demodbs all md5
...
@@ -641,7 +662,7 @@ local db1,db2,@demodbs all md5
</para>
</para>
<para>
<para>
Client principals must have their <productname>PostgreSQL</> user
Client principals must have their <productname>PostgreSQL</> database user
name as their first component, for example
name as their first component, for example
<literal>pgusername/otherstuff@realm</>. At present the realm of
<literal>pgusername/otherstuff@realm</>. At present the realm of
the client is not checked by <productname>PostgreSQL</>; so if you
the client is not checked by <productname>PostgreSQL</>; so if you
...
@@ -661,7 +682,7 @@ local db1,db2,@demodbs all md5
...
@@ -661,7 +682,7 @@ local db1,db2,@demodbs all md5
</para>
</para>
<para>
<para>
The keytab file is generated in the Kerberos system, see the
The keytab file is generated by the Kerberos software; see the
Kerberos documentation for details. The following example is
Kerberos documentation for details. The following example is
for MIT-compatible Kerberos 5 implementations:
for MIT-compatible Kerberos 5 implementations:
<screen>
<screen>
...
@@ -672,10 +693,10 @@ local db1,db2,@demodbs all md5
...
@@ -672,10 +693,10 @@ local db1,db2,@demodbs all md5
<para>
<para>
When connecting to the database make sure you have a ticket for a
When connecting to the database make sure you have a ticket for a
principal matching the requested database user name. An example: For
principal matching the requested database user name. For example, for
database user name <literal>fred</>, both principal
database user name <literal>fred</>, both principal
<literal>fred@EXAMPLE.COM</> and
<literal>fred@EXAMPLE.COM</> and
<literal>fred/users.example.com@EXAMPLE.COM</> can be used to
<literal>fred/users.example.com@EXAMPLE.COM</> could be used to
authenticate to the database server.
authenticate to the database server.
</para>
</para>
...
@@ -900,7 +921,7 @@ FATAL: no pg_hba.conf entry for host "123.123.123.123", user "andym", database
...
@@ -900,7 +921,7 @@ FATAL: no pg_hba.conf entry for host "123.123.123.123", user "andym", database
This is what you are most likely to get if you succeed in contacting
This is what you are most likely to get if you succeed in contacting
the server, but it does not want to talk to you. As the message
the server, but it does not want to talk to you. As the message
suggests, the server refused the connection request because it found
suggests, the server refused the connection request because it found
no authorizing entry in its <filename>pg_hba.conf</filename>
no matching entry in its <filename>pg_hba.conf</filename>