From d610f4e575b6ee634b94dc6cb9125c4dbaedc305 Mon Sep 17 00:00:00 2001 From: "Jonathan S. Katz" Date: Fri, 5 Apr 2019 12:02:40 -0400 Subject: [PATCH] Add a warning about the client authentication defaults that initdb provides. This also provides advice on how to securely set up initial client connection configurations, and removes the section that explains similar steps that is below the directory setup. This information should be around where its explained how initdb is first called, anyway. --- doc/src/sgml/runtime.sgml | 46 +++++++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/doc/src/sgml/runtime.sgml b/doc/src/sgml/runtime.sgml index e053e2ee34..040aacf87f 100644 --- a/doc/src/sgml/runtime.sgml +++ b/doc/src/sgml/runtime.sgml @@ -85,6 +85,31 @@ described in the previous section. + + + By default initdb sets up trust + client authentication for connecting to the database. This is not + recommended on multi-user systems where you do not trust all users, nor if + the database server will be made accessible to remote systems. + + + We recommend using the , , + or flags to assign a password to the database + superuser, and to override the pg_hba.conf default + generation using for local connections, + (except on Windows, use as + peer authentication is not supported) and + for remote connections. See + for more information on client + authentication methods. + + + If installing PostgreSQL from a distribution, we recommend you validate + your initially generated pg_hba.conf file to ensure + it meets your operational requirements. + + + As an alternative to the option, you can set @@ -155,27 +180,6 @@ postgres$ initdb -D /usr/local/pgsql/data for directories and 0640 for files. - - However, while the directory contents are secure, the default - client authentication setup allows any local user to connect to the - database and even become the database superuser. If you do not - trust other local users, we recommend you use one of - initdb's , - or options to assign a password to the - database superuser. - password - of the superuser - - Also, specify or - so that the default trust authentication - mode is not used; or modify the generated pg_hba.conf - file after running initdb, but - before you start the server for the first time. (Other - reasonable approaches include using peer authentication - or file system permissions to restrict connections. See for more information.) - - initdb also initializes the default localelocale for the database cluster. -- 2.14.3 (Apple Git-98)