Commit 37e55354 authored by Bruce Momjian's avatar Bruce Momjian

Add mention of init -W flag for security.

parent 220d0068
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.97 2001/11/21 06:09:45 thomas Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.98 2001/11/28 00:13:30 momjian Exp $
--> -->
<Chapter Id="runtime"> <Chapter Id="runtime">
...@@ -51,28 +51,28 @@ $Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.97 2001/11/21 06:09:45 tho ...@@ -51,28 +51,28 @@ $Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.97 2001/11/21 06:09:45 tho
<para> <para>
Before you can do anything, you must initialize a database storage Before you can do anything, you must initialize a database storage
area on disk. We call this a <firstterm>database area on disk. We call this a <firstterm>database cluster</firstterm>.
cluster</firstterm>. (<acronym>SQL</acronym> speaks of a catalog (<acronym>SQL</acronym> speaks of a catalog cluster instead.) A
cluster instead.) A database cluster is a collection of databases database cluster is a collection of databases that will be accessible
that will be accessible through a single instance of a running through a single instance of a running database server. After
database server. After initialization, a database cluster will initialization, a database cluster will contain one database named
contain one database named <literal>template1</literal>. As the <literal>template1</literal>. As the name suggests, this will be used
name suggests, this will be used as a template for any subsequently as a template for any subsequently created database; it should not be
created database; it should not be used for actual work. used for actual work.
</para> </para>
<para> <para>
In file system terms, a database cluster will be a single directory In file system terms, a database cluster will be a single directory
under which all data will be stored. We call this the under which all data will be stored. We call this the <firstterm>data
<firstterm>data directory</firstterm> or <firstterm>data directory</firstterm> or <firstterm>data area</firstterm>. It is
area</firstterm>. It is completely up to you where you choose to completely up to you where you choose to store your data, there is no
store your data, there is no default, although locations such as default, although locations such as
<filename>/usr/local/pgsql/data</filename> or <filename>/usr/local/pgsql/data</filename> or
<filename>/var/lib/pgsql/data</filename> are popular. To initialize <filename>/var/lib/pgsql/data</filename> are popular. To initialize a
a database cluster, use the command <command>initdb</command>, database cluster, use the command <command>initdb</command>, which is
which is installed with <productname>PostgreSQL</productname>. The installed with <productname>PostgreSQL</productname>. The desired
desired file system location of your database system is indicated file system location of your database system is indicated by the
by the <option>-D</option> option, for example <option>-D</option> option, for example
<screen> <screen>
&gt; <userinput>initdb -D /usr/local/pgsql/data</userinput> &gt; <userinput>initdb -D /usr/local/pgsql/data</userinput>
</screen> </screen>
...@@ -118,6 +118,19 @@ postgres&gt; <userinput>initdb -D /usr/local/pgsql/data</userinput> ...@@ -118,6 +118,19 @@ postgres&gt; <userinput>initdb -D /usr/local/pgsql/data</userinput>
permissions from everyone but the <productname>PostgreSQL</productname> user account. permissions from everyone but the <productname>PostgreSQL</productname> user account.
</para> </para>
<para>
However, while the directory contents are secure, the default
<filename>pg_hba.conf</filename> authentication of
<literal>trust</literal> allows any local user to become the
superuser and connect to the database. If you don't trust your local
users, we recommend you use the <command>initdb</command> option
<option>-W</option> or <option>--pwprompt</option> to assign a
password to the superuser and modify your
<filename>pg_hba.conf</filename> accordingly. (Another option:
Your operating system may support <literal>ident</literal> for
local connections.)
</para>
<para> <para>
<indexterm><primary>LC_COLLATE</></> <indexterm><primary>LC_COLLATE</></>
One surprise you might encounter while running <command>initdb</command> is One surprise you might encounter while running <command>initdb</command> is
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment